forked from qt-creator/qt-creator
Doc: Add a reference topic for the Text Editor view
Add links to the new topic. Change-Id: I92640385feba70a56bacfe24497eeba3d8409567 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
BIN
doc/qtcreator/images/qtquick-text-editor.png
Normal file
BIN
doc/qtcreator/images/qtquick-text-editor.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
@@ -115,6 +115,7 @@
|
||||
\li \l{Transition Editor}
|
||||
\li \l{Timeline}
|
||||
\li \l{Curve Editor}
|
||||
\li \l{Text Editor}
|
||||
\endlist
|
||||
\li \l {Creating UIs}
|
||||
\list
|
||||
|
@@ -190,8 +190,8 @@
|
||||
\endlist
|
||||
|
||||
We now want to add code to move the bubble based on Accelerometer sensor
|
||||
values. This is not supported by \uicontrol {Form Editor}, so we will do
|
||||
it in \uicontrol {Text Editor}:
|
||||
values. This is not supported by \l {Form Editor}, so we will do
|
||||
it in \l {Text Editor}:
|
||||
|
||||
\list 1
|
||||
\li Add the following import statement to \e main.qml:
|
||||
|
@@ -48,7 +48,7 @@
|
||||
\include qtquick-tutorial-create-empty-project.qdocinc qtquick empty application
|
||||
|
||||
\QC generates a component file, \e main.qml, and opens it in
|
||||
\uicontrol {Text Editor}. The wizard template uses the \l Window component,
|
||||
\l {Text Editor}. The wizard template uses the \l Window component,
|
||||
which does not support adding states. Because we want to use states in
|
||||
this example, we first replace the Window component with a \l {basic-rectangle}
|
||||
{Rectangle} component. We must also remove the line that sets the \c title
|
||||
|
@@ -172,7 +172,7 @@
|
||||
\endlist
|
||||
|
||||
You can replace the default model and delegate with other,
|
||||
more complex models and delegates in \uicontrol {Text Editor}.
|
||||
more complex models and delegates in \l {Text Editor}.
|
||||
\l{ItemDelegate}{Item Delegate} and \l{SwipeDelegate}{Swipe Delegate}
|
||||
components are also available in \uicontrol Library.
|
||||
|
||||
|
@@ -50,8 +50,8 @@
|
||||
objects compared to the other versions of the scene. The Low, Combined and
|
||||
Vertex scenes include less objects since they have been optimized by, for
|
||||
example, combining geometry and baking materials into textures. The
|
||||
following image displays the components in each scene in \uicontrol
|
||||
Navigator to illustrate the structural differences between the scenes.
|
||||
following image displays the components in each scene in \l Navigator to
|
||||
illustrate the structural differences between the scenes.
|
||||
|
||||
\image studio-kitchen-navigators.png "Navigators for the four scenes in the Optimal 3D Scene."
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
In \QC, the scene graph is represented by the tree-like view in
|
||||
\uicontrol Navigator. You can also view the hierarchy of nodes in the
|
||||
\uicontrol {Text Editor} view. By minimizing the size of the scene graph,
|
||||
\l {Text Editor} view. By minimizing the size of the scene graph,
|
||||
you can minimize the effort needed when running the scene. In terms of
|
||||
optimization, you should avoid unnecessary groups and complex hierarchy when
|
||||
possible. Deep hierarchies with complex parenting increase the performance
|
||||
|
@@ -26,7 +26,7 @@
|
||||
/*!
|
||||
\page qtquick-curve-editor.html
|
||||
\previouspage qtquick-timeline-view.html
|
||||
\nextpage creator-projects-view.html
|
||||
\nextpage qtquick-text-editor.html
|
||||
|
||||
\title Curve Editor
|
||||
|
||||
|
@@ -118,7 +118,7 @@
|
||||
handlers to modify the curve.
|
||||
\li \l {Editing Animation Curves}
|
||||
\row
|
||||
\li \l{Working in Edit Mode}{Text Editor}
|
||||
\li \l{Text Editor}
|
||||
\li Provides a code editor for viewing and modifying the code
|
||||
generated by the visual editors.
|
||||
\li \l {Working in Edit Mode}
|
||||
|
@@ -90,7 +90,7 @@
|
||||
\image qtquick-components-tab-add.png "Select Modules to Add"
|
||||
|
||||
This adds an \e {import statement} to the component code that you
|
||||
can see in \uicontrol {Text Editor}. For example, if you add the
|
||||
can see in \l {Text Editor}. For example, if you add the
|
||||
\uicontrol QtQuick.Controls module, the following import statement
|
||||
is added to the code: \c {import QtQuick.Controls}.
|
||||
|
||||
|
@@ -158,7 +158,7 @@
|
||||
\section1 Arranging Components
|
||||
|
||||
You can view the order of components in a component file in \uicontrol Navigator
|
||||
and \uicontrol {Text Editor}. The order of components in the file also
|
||||
and \l {Text Editor}. The order of components in the file also
|
||||
determines the order in which they are drawn in \uicontrol {Form Editor}.
|
||||
By default, components that are located at the top of the file are listed at
|
||||
the bottom of the \uicontrol Navigator tree and behind overlapping
|
||||
|
@@ -116,7 +116,7 @@
|
||||
(\uicontrol {Reset Anchors}) button to reset the anchors to their saved
|
||||
state.
|
||||
|
||||
You can specify the baseline anchor in \uicontrol {Text Editor}.
|
||||
You can specify the baseline anchor in \l{Text Editor}.
|
||||
|
||||
For performance reasons, you can only anchor a component to its siblings
|
||||
and direct parent. By default, a component is anchored to its parent when
|
||||
|
@@ -79,7 +79,7 @@
|
||||
and then add animation to the change between the states.
|
||||
|
||||
The properties that you change in a state are highlighted with blue color.
|
||||
In \uicontrol {Text Editor}, you can see the changes recorded as changes
|
||||
In \l{Text Editor}, you can see the changes recorded as changes
|
||||
to the base state.
|
||||
|
||||
\image qmldesigner-states.png "States and Properties views"
|
||||
|
56
doc/qtcreator/src/qtquick/qtquick-text-editor.qdoc
Normal file
56
doc/qtcreator/src/qtquick/qtquick-text-editor.qdoc
Normal file
@@ -0,0 +1,56 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
**
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\page qtquick-text-editor.html
|
||||
\previouspage qtquick-curve-editor.html
|
||||
\if defined(qtdesignstudio)
|
||||
\nextpage creator-projects-view.html
|
||||
\else
|
||||
\nextpage quick-uis.html
|
||||
\endif
|
||||
|
||||
\title Text Editor
|
||||
|
||||
In the \uicontrol {Text Editor} view, you can view and modify the code in a
|
||||
\l{UI Files}{UI file} (.ui.qml) or component file (.qml) that is generated
|
||||
when you create components in \l{Form Editor} or \l{3D Editor} and specify
|
||||
their properties in \l Properties.
|
||||
|
||||
\image qtquick-text-editor.png "Text Editor"
|
||||
|
||||
You can also view and modify other types of text files.
|
||||
|
||||
You can use a subset of the functions available in the
|
||||
\l{Writing Code}{Edit mode}:
|
||||
|
||||
\list
|
||||
\li \l{Semantic Highlighting}
|
||||
\li \l{Checking Code Syntax}
|
||||
\li \l{Completing Code}
|
||||
\li \l{Indenting Text or Code}
|
||||
\li \l{Using Qt Quick Toolbars}
|
||||
\endlist
|
||||
*/
|
@@ -42,7 +42,7 @@
|
||||
|
||||
You can use \QC wizards to create UI files that have the filename
|
||||
extension \e .ui.qml. The UI files can be edited in \l {Form Editor}.
|
||||
If you use \uicontrol {Text Editor} to add code that is not supported
|
||||
If you use \l {Text Editor} to add code that is not supported
|
||||
by \uicontrol {Form Editor}, \QC displays error messages.
|
||||
|
||||
The following features are not supported:
|
||||
|
@@ -29,7 +29,7 @@
|
||||
\previouspage creator-exporting-qml.html
|
||||
\nextpage studio-app-flows.html
|
||||
\else
|
||||
\previouspage creator-using-qt-quick-designer.html
|
||||
\previouspage qtquick-text-editor.html
|
||||
\nextpage quick-components.html
|
||||
\endif
|
||||
|
||||
|
@@ -119,7 +119,7 @@
|
||||
layout. Every UI file consists of two parts: an imports section and an
|
||||
component declaration section. The components and functionality most common to
|
||||
UIs are provided in the QtQuick import. You can view the code of an
|
||||
.ui.qml file in the \uicontrol {Text Editor} view.
|
||||
.ui.qml file in the \l{Text Editor} view.
|
||||
|
||||
For more information about creating a component file from scratch, see
|
||||
\l{First Steps with QML}.
|
||||
|
@@ -73,7 +73,7 @@
|
||||
for the states to bind the properties to the states using \c when
|
||||
conditions. First, we specify that a button instance enters the \e checked
|
||||
state when the \l {AbstractButton::}{checked} property is set to \c true.
|
||||
This is how the code will look in the \uicontrol {Text Editor}:
|
||||
This is how the code will look in \l{Text Editor}:
|
||||
|
||||
\quotefromfile SideMenu/CustomButton.qml
|
||||
\skipto states: [
|
||||
|
@@ -204,7 +204,7 @@
|
||||
|
||||
Some signals are predefined for the \l {Mouse Area} component, some we have to
|
||||
add ourselves. For example, let's look at the start button that we use
|
||||
in \e StartScreen.ui.qml. First, we use the \uicontrol {Text Editor} view
|
||||
in \e StartScreen.ui.qml. First, we use the \l{Text Editor} view
|
||||
to create the \c startClicked signal:
|
||||
|
||||
\quotefromfile washingMachineUI/StartScreen.ui.qml
|
||||
|
@@ -173,7 +173,7 @@
|
||||
context menu. Any changes we make to a component are immediately visible in
|
||||
all the other components where it appears.
|
||||
|
||||
We can view the QML code for each component in the \uicontrol {Text Editor}.
|
||||
We can view the QML code for each component in \l{Text Editor}.
|
||||
|
||||
We can now use states and the timeline to animate the components in the UI.
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Design Studio documentation.
|
||||
@@ -31,14 +31,13 @@
|
||||
\title Advanced Topics
|
||||
|
||||
\QDS attempts to meet your needs, whether you have previous experience with
|
||||
QML, and coding or not. When you install \QDS, the default configuration
|
||||
QML and coding or not. When you install \QDS, the default configuration
|
||||
allows you to start designing and previewing UIs with very little effort.
|
||||
|
||||
However, you might want to use the \uicontrol {Text Editor} in the Design
|
||||
mode sometimes to edit your QML files or write some JavaScript to simulate
|
||||
application logic and bring your UI to life. If you use JavaScript, you
|
||||
might also want to debug and profile you UIs to find and fix problems in
|
||||
them.
|
||||
However, you might want to use the \l{Text Editor} view sometimes to edit
|
||||
your component files (.qml) or write some JavaScript to simulate application
|
||||
logic and bring your UI to life. If you use JavaScript, you might also want
|
||||
to debug and profile you UIs to find and fix problems in them.
|
||||
|
||||
You can also use special options to start \QC from the command line and use
|
||||
it mainly from the keyboard.
|
||||
@@ -55,12 +54,11 @@
|
||||
as well as import and export keyboard shortcut mapping schemes.
|
||||
\li \l{Coding}
|
||||
|
||||
You can use the code editor in the Design mode
|
||||
\uicontrol {Text Editor} view or in the Edit mode to modify QML
|
||||
code. The code editor understands the QML language as code, not
|
||||
just as plain text. This enables it to provide you with useful
|
||||
features, such as semantic highlighting, checking code syntax,
|
||||
code completion, and refactoring actions.
|
||||
You can use the code editor in the \uicontrol {Text Editor} view or
|
||||
in the Edit mode to modify QML code. The code editor understands
|
||||
the QML language as code, not just as plain text. This enables it
|
||||
to provide you with useful features, such as semantic highlighting,
|
||||
checking code syntax, code completion, and refactoring actions.
|
||||
\li \l{Simulating Data Input}
|
||||
|
||||
\QDS enables you to connect UIs to different forms of data from various
|
||||
|
@@ -94,7 +94,7 @@
|
||||
|
||||
\note The layer that was the bottom layer in the design tool becames the top
|
||||
layer in \uicontrol Navigator to reflect the QML code model. You
|
||||
can view the QML code in \uicontrol {Text Editor}.
|
||||
can view the QML code in \l{Text Editor}.
|
||||
|
||||
After importing the metadata files, wait a few moments to allow all
|
||||
imported assets to appear in your project files before selecting your
|
||||
|
@@ -94,7 +94,7 @@
|
||||
\code
|
||||
singleton Values 1.0 Values.qml
|
||||
\endcode
|
||||
\li Open \e Values.qml in the \uicontrol {Text Editor} for editing.
|
||||
\li Open \e Values.qml in \l{Text Editor} for editing.
|
||||
\li Add the following code to the top of the file to register the
|
||||
QObject-derived class that you will use to expose the global
|
||||
properties as a singleton type:
|
||||
|
@@ -68,6 +68,7 @@
|
||||
\li \l{Transition Editor}
|
||||
\li \l{Timeline}
|
||||
\li \l{Curve Editor}
|
||||
\li \l{Text Editor}
|
||||
\li \l{Projects}
|
||||
\li \l{File System}
|
||||
\li \l{Open Documents}
|
||||
|
@@ -143,7 +143,7 @@
|
||||
|
||||
\li Adjust the canvas size of your project in \QDS according to the screen
|
||||
size in \Q3DS presentation by editing the \c Constants.qml file in
|
||||
\uicontrol {Text Editor}. If you cannot see the \uicontrol {Text Editor}
|
||||
\l{Text Editor}. If you cannot see the \uicontrol {Text Editor}
|
||||
view, select \uicontrol Window > \uicontrol {Views}, and then select the
|
||||
\uicontrol {Text Editor} checkbox. In the \uicontrol Projects view, open
|
||||
the imports subfolder, then the subfolder named after your project, and
|
||||
|
@@ -83,7 +83,7 @@
|
||||
To render a Skybox or Skydome instead of clearing the scene,
|
||||
select \uicontrol SkyBox. You can specify the image to use as
|
||||
a value of the \l{SceneEnvironment::lightProbe}{lightProbe}
|
||||
property in \uicontrol {Text Editor}.
|
||||
property in \l{Text Editor}.
|
||||
|
||||
To leave the scene uncleared, select \uicontrol {Unspecified}.
|
||||
|
||||
|
Reference in New Issue
Block a user