Merge "Merge remote-tracking branch 'origin/4.15'"
57
dist/changes-4.15.0.md
vendored
@@ -94,6 +94,8 @@ Projects
|
||||
* Added `Open Terminal Here` for project nodes (QTCREATORBUG-25107)
|
||||
* Added option for running application as root user (QTCREATORBUG-2831,
|
||||
QTCREATORBUG-25330)
|
||||
* Fixed detection of Designer, Linguist, `qmlscene` and `qmlplugindump` for Qt 6
|
||||
cross-builds
|
||||
|
||||
### qmake
|
||||
|
||||
@@ -109,6 +111,7 @@ Projects
|
||||
* Added automatic run of conan install on initial CMake call
|
||||
(QTCREATORBUG-25362)
|
||||
* Added batch editing for CMake configuration
|
||||
* Added `Re-configure with Initial Parameters` button
|
||||
* Made it possible to copy CMake variables from configuration
|
||||
(QTCREATORBUG-24781)
|
||||
* Removed utility targets from CMake target locator filters (QTCREATORBUG-24718)
|
||||
@@ -192,6 +195,7 @@ Platforms
|
||||
### iOS
|
||||
|
||||
* Added support for CMake projects with Qt 6 (QTCREATORBUG-23574)
|
||||
* Fixed launch of applications on iOS 14 (QTCREATORBUG-24672)
|
||||
* Fixed `Attach to Running Application` for long executable paths
|
||||
(QTCREATORBUG-25286)
|
||||
|
||||
@@ -203,6 +207,7 @@ Platforms
|
||||
### MCU
|
||||
|
||||
* Added error reporting when creating MCU kits fails (QTCREATORBUG-25258)
|
||||
* Improved detection of Ultralight library (QTCREATORBUG-25469)
|
||||
* Fixed that examples were missing from `Welcome` screen (QTCREATORBUG-25320)
|
||||
|
||||
### WASM
|
||||
@@ -210,7 +215,59 @@ Platforms
|
||||
* Improved handling of Emscripten detection and setup (QTCREATORBUG-23126,
|
||||
QTCREATORBUG-23160, QTCREATORBUG-23561, QTCREATORBUG-23741,
|
||||
QTCREATORBUG-24814, QTCREATORBUG-24822)
|
||||
* Added support for Qt 6 applications with CMake (QTCREATORBUG-25519)
|
||||
* Fixed ABI detection for Qt 5.15 (QTCREATORBUG-24891)
|
||||
|
||||
Credits for these changes go to:
|
||||
--------------------------------
|
||||
Aleksei German
|
||||
Alessandro Portale
|
||||
Alexandru Croitor
|
||||
Alexis Jeandet
|
||||
Andre Hartmann
|
||||
André Pönitz
|
||||
Bernhard Beschow
|
||||
Björn Schäpers
|
||||
BogDan Vatra
|
||||
Christiaan Janssen
|
||||
Christian Kandeler
|
||||
Christian Stenger
|
||||
Cristian Adam
|
||||
David Schulz
|
||||
Dawid Śliwa
|
||||
Denis Shienkov
|
||||
Dmitriy Purgin
|
||||
Eike Ziller
|
||||
Erik Verbruggen
|
||||
Fabio Falsini
|
||||
Fawzi Mohamed
|
||||
Friedemann Kleint
|
||||
Henning Gruendl
|
||||
Jacopo Martellini
|
||||
Jaroslaw Kobus
|
||||
Johanna Vanhatapio
|
||||
Kai Köhne
|
||||
Kevin Funk
|
||||
Knud Dollereder
|
||||
Leander Schulten
|
||||
Leena Miettinen
|
||||
Mahmoud Badri
|
||||
Marco Bubke
|
||||
Mattias Johansson
|
||||
Maximilian Goldstein
|
||||
Michael Weghorn
|
||||
Michael Winkelmann
|
||||
Miikka Heikkinen
|
||||
Mitch Curtis
|
||||
Nikolai Kosjar
|
||||
Orgad Shaneh
|
||||
Oswald Buddenhagen
|
||||
Raphaël Cotty
|
||||
Sergey Levin
|
||||
Thomas Hartmann
|
||||
Tim Jenssen
|
||||
Timon Riedelbauch
|
||||
Tom Praschan
|
||||
Tuomo Pelkonen
|
||||
Ulf Hermann
|
||||
Vikas Pachdha
|
||||
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 14 KiB |
@@ -477,46 +477,46 @@
|
||||
\row
|
||||
\li M220
|
||||
\li Error
|
||||
\li This type (type name) is not supported as a root element of a Qt
|
||||
Quick UI form.
|
||||
\li This type (type name) is not supported as a root element of a
|
||||
UI file (.ui.qml).
|
||||
\li
|
||||
|
||||
\row
|
||||
\li M221
|
||||
\li Error
|
||||
\li This type (type name) is not supported in a Qt Quick UI form.
|
||||
\li This type (type name) is not supported in a UI file (.ui.qml).
|
||||
\li
|
||||
|
||||
\row
|
||||
\li M222
|
||||
\li Error
|
||||
\li Functions are not supported in a Qt Quick UI form.
|
||||
\li Functions are not supported in a UI file (.ui.qml).
|
||||
\li For a list of supported JavaScript functions, see
|
||||
\l{Supported Methods}.
|
||||
|
||||
\row
|
||||
\li M223
|
||||
\li Error
|
||||
\li Java Script blocks are not supported in a Qt Quick UI form.
|
||||
\li Java Script blocks are not supported in a UI file (.ui.qml).
|
||||
\li
|
||||
|
||||
\row
|
||||
\li M224
|
||||
\li Error
|
||||
\li Behavior type is not supported in a Qt Quick UI form.
|
||||
\li Behavior type is not supported in a UI file (.ui.qml).
|
||||
\li
|
||||
|
||||
\row
|
||||
\li M225
|
||||
\li Error
|
||||
\li States are only supported in the root item in a Qt Quick UI form.
|
||||
\li States are only supported in the root item in a UI file (.ui.qml).
|
||||
\li
|
||||
|
||||
\row
|
||||
\li M226
|
||||
\li Error
|
||||
\li Referencing the parent of the root item is not supported in a Qt
|
||||
Quick UI form.
|
||||
\li Referencing the parent of the root item is not supported in a
|
||||
UI file (.ui.qml).
|
||||
\li
|
||||
|
||||
\row
|
||||
|
@@ -302,8 +302,9 @@
|
||||
|
||||
\li QML files, which specify items in Qt Quick projects.
|
||||
\uicontrol {QML File (Qt Quick 2)} creates a QML file that imports
|
||||
Qt Quick 2.0 and \uicontrol {Qt Quick UI File} creates an UI form
|
||||
(\e .ui.qml) and the corresponding QML file.
|
||||
Qt Quick 2.0, and \uicontrol {Qt Quick UI File} creates a
|
||||
\l{UI Files}{UI file} (\e .ui.qml) and the corresponding
|
||||
implementation file (\e .qml).
|
||||
|
||||
\li JavaScript files that you can use to write the application logic in
|
||||
Qt Quick projects
|
||||
|
@@ -117,11 +117,11 @@
|
||||
\li \l{Creating Scalable Buttons and Borders}
|
||||
\endlist
|
||||
\li \l{Specifying Component Properties}
|
||||
\li \l{Positioning Items}
|
||||
\li \l{Positioning Components}
|
||||
\li \l{Using Custom Fonts}
|
||||
\li \l{Annotating Designs}
|
||||
\li \l{Loading Placeholder Data}
|
||||
\li \l{Qt Quick UI Forms}
|
||||
\li \l{UI Files}
|
||||
\endlist
|
||||
\li \l {Adding Dynamics}
|
||||
\list
|
||||
@@ -146,12 +146,11 @@
|
||||
\li \l{Exporting from Maya}{Maya}
|
||||
\endlist
|
||||
\li \l{Importing 3D Assets}
|
||||
\li \l{Editing 3D Assets in Design Mode}
|
||||
\li \l{Adding 3D Views}
|
||||
\li \l{Using 3D Components}
|
||||
\list
|
||||
\li \l{Setting Group Properties}
|
||||
\li \l{Adding Models}
|
||||
\li \l{Adding 3D Models}
|
||||
\li \l{Using Materials and Shaders}
|
||||
\li \l{Attaching Textures to Materials}
|
||||
\li \l{Using 3D Materials}
|
||||
@@ -166,7 +165,7 @@
|
||||
\li \l {Browsing ISO 7000 Icons}
|
||||
\li \l {Using QML Modules with Plugins}
|
||||
\li \l {Converting UI Projects to Applications}
|
||||
\li \l {Exporting QML}
|
||||
\li \l {Exporting Components}
|
||||
\endlist
|
||||
\li \l{Developing Widget Based Applications}
|
||||
\list
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -101,9 +101,9 @@
|
||||
convert them to Qt Quick Application projects that contain .pro,
|
||||
.cpp, and .qrc files.
|
||||
|
||||
\li \l {Exporting QML}
|
||||
\li \l {Exporting Components}
|
||||
|
||||
\l{Qt Quick UI Forms}{UI forms} (ui.qml files) can be exported to
|
||||
\l{UI Files}{UI files} (.ui.qml) can be exported to
|
||||
JSON metadata format and PNG assets.
|
||||
|
||||
\endlist
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -34,8 +34,8 @@
|
||||
|
||||
You can add icons from an ISO 7000 icon library that is installed with \QC
|
||||
to Qt Quick applications (commercial only). You can use the
|
||||
\uicontrol {ISO Icon Browser} to add a \l {Picture} type and select the
|
||||
icon to use for the type. You can change the default color of the icon.
|
||||
\uicontrol {ISO Icon Browser} to add a \l {Picture} component and select the
|
||||
icon to use for the component. You can change the default color of the icon.
|
||||
|
||||
\image qtcreator-iso-icon-browser.png
|
||||
|
||||
@@ -45,16 +45,16 @@
|
||||
|
||||
\li Create a new Qt Quick Application or open an application in \QC.
|
||||
|
||||
\li Open the Qt Quick UI form in the \uicontrol Design mode.
|
||||
\li Open the \l{UI Files}{UI file} (.ui.qml) in \l {Form Editor}.
|
||||
|
||||
\li In the \uicontrol Library, select \uicontrol {QML Imports} >
|
||||
\uicontrol {Add Import} > \uicontrol {QtQuick.Extras} to import the
|
||||
\l {Qt Quick Extras} module.
|
||||
\li Select \l Library > \uicontrol Components > \inlineimage plus.png
|
||||
> \uicontrol {QtQuick.Extras} to import the \l {Qt Quick Extras}
|
||||
module.
|
||||
|
||||
\li Drag and drop a \uicontrol Picture element from the library to the
|
||||
canvas.
|
||||
\li Drag and drop a \uicontrol Picture component from \uicontrol Library
|
||||
to \l {Form Editor}.
|
||||
|
||||
\li Right-click the picture element and select \uicontrol {Choose Icon}
|
||||
\li Right-click the picture component and select \uicontrol {Choose Icon}
|
||||
to open the \uicontrol {ISO Icon Browser}.
|
||||
|
||||
\li To find icons, select a criterion for filtering icons and enter a
|
||||
|
@@ -48,9 +48,9 @@
|
||||
|
||||
\section1 Naming Conventions
|
||||
|
||||
Establish naming conventions to keep the items in your UI organized.
|
||||
Name your items accurately and give them suitable QML IDs. You should
|
||||
manually specify the names of the items you export from design tools to
|
||||
Establish naming conventions to keep the components in your UI organized.
|
||||
Name your components accurately and give them suitable IDs. You should
|
||||
manually specify the names of the components you export from design tools to
|
||||
create reliable and self-explanatory names that follow the naming
|
||||
conventions you have established.
|
||||
|
||||
@@ -82,20 +82,21 @@
|
||||
components that can be conveniently recombined to suit the needs of
|
||||
your UI.
|
||||
\li Use as few components as necessary. To minimize the number of
|
||||
components, use alias properties and states to create the
|
||||
differences in your instances. We recommend reusing components
|
||||
components, use \l{Adding Property Aliases}{alias properties} and
|
||||
\l{Adding States}{states} to create the differences in your
|
||||
component instances. We recommend reusing components
|
||||
instead of duplicating them, so the components do not need to be
|
||||
processed as completely new types. This reduces loading and
|
||||
compilation time as well as the size of the binary.
|
||||
processed as completely new component types. This reduces loading
|
||||
and compilation time as well as the size of the binary.
|
||||
\li Any content that is data-driven should be
|
||||
\l {Using Qt Quick UI Forms}{exported as a public property} of the
|
||||
\l {Using UI Files}{exported as a public property} of the
|
||||
relevant component. For example, a speedometer should have an \c int
|
||||
or \c real property for speed to which the UI is bound.
|
||||
\li Separate UI from the application logic. Designers should work with
|
||||
the UI forms (.ui.qml files), while developers should work on the
|
||||
corresponding QML files (.qml) to define their programmatic
|
||||
behaviors or JavaScript. This enables iteration from both the design
|
||||
and development side of the process without the the risk of
|
||||
overwriting each other's work.
|
||||
the \l{UI Files}{UI files} (.ui.qml), while developers should work
|
||||
on the corresponding implementation files (.qml) to define their
|
||||
programmatic behaviors or JavaScript. This enables iteration from
|
||||
both the design and development side of the process without the the
|
||||
risk of overwriting each other's work.
|
||||
\endlist
|
||||
*/
|
||||
|
@@ -273,7 +273,7 @@
|
||||
and set the button text for each button instance, for example.
|
||||
|
||||
For more information about positioning buttons on screens, see
|
||||
\l{Positioning Items}.
|
||||
\l{Positioning Components}.
|
||||
|
||||
\image qmldesigner-borderimage.png "Button preview as part of a screen"
|
||||
*/
|
||||
|
@@ -83,7 +83,7 @@
|
||||
\li \l{Adding Signal Handlers}
|
||||
\row
|
||||
\li Go to Implementation
|
||||
\li \l{Using Qt Quick UI Forms}
|
||||
\li \l{Using UI Files}
|
||||
\row
|
||||
\li Go into Component
|
||||
\li \l{Moving Within Components}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -32,46 +32,44 @@
|
||||
\nextpage creator-using-qt-designer.html
|
||||
\endif
|
||||
|
||||
\title Exporting QML
|
||||
\title Exporting Components
|
||||
|
||||
\l{Qt Quick UI Forms}{UI forms} (ui.qml files) can be exported to
|
||||
JSON metadata format and PNG assets.
|
||||
\l{glossary-component}{Components} contained in \l{UI Files}
|
||||
{UI files} (.ui.qml) can be exported to JSON metadata format and PNG assets.
|
||||
|
||||
To export the \l{Qt Quick UI Forms}{UI forms} (ui.qml files) from the
|
||||
current project, select \uicontrol Build > \uicontrol {Export QML}.
|
||||
To export the UI files from the current project, select \uicontrol Build >
|
||||
\uicontrol {Export Components}.
|
||||
|
||||
The primary use of exported metadata and assets is to generate native file
|
||||
formats in content creation tools, such as Adobe Photoshop, using \QB. \QBPS
|
||||
can generate PSD files by importing the metadata and assets.
|
||||
|
||||
QML is exported as follows:
|
||||
Components are exported as follows:
|
||||
|
||||
\list
|
||||
\li QML types inherited from \l [QML]{Item}{Item} are exported, other
|
||||
types are ignored.
|
||||
\li Components (QML types) inherited from \l [QML]{Item}{Item} are
|
||||
exported, other components are ignored.
|
||||
\li \l [QML]{Text}{Text} components are exported as metadata only
|
||||
and no assets are generated.
|
||||
\li \l [QML]{Rectangle}{Rectangle} and \l [QML]{Image}{Image} types
|
||||
generate assets as PNG files.
|
||||
\li \l [QML]{Rectangle}{Rectangle} and \l [QML]{Image}{Image}
|
||||
components generate assets as PNG files.
|
||||
\endlist
|
||||
|
||||
\section1 Configuring QML Export
|
||||
|
||||
You can configure the export in the \uicontrol {Export QML} dialog, which
|
||||
lists the \l{Qt Quick UI Forms}{UI forms} (ui.qml files) of the current
|
||||
project.
|
||||
You can configure the export in the \uicontrol {Export Components} dialog,
|
||||
which lists the UI files (.ui.qml) of the current project.
|
||||
|
||||
\image qtquick-qml-export-dialog.png "QML Export Dialog"
|
||||
\image qtquick-qml-export-dialog.png "Export Components dialog"
|
||||
|
||||
\list 1
|
||||
\li In the \uicontrol {Export path} field, specify the path where
|
||||
the metadata file and assets are exported.
|
||||
\li Deselect the \uicontrol {Export assets} check box to disable
|
||||
exporting assets and only generate the metadata file.
|
||||
\li Select the \uicontrol {Export components separately} check box to generate separate
|
||||
metadata files for each component.
|
||||
\li In the file list, select the \l{Qt Quick UI Forms}{UI forms}
|
||||
to be exported.
|
||||
\li Select the \uicontrol {Export components separately} check box to
|
||||
generate separate metadata files for each component.
|
||||
\li In the file list, select the .ui.qml files to be exported.
|
||||
\li Select \uicontrol {Export} export to start the export process.
|
||||
\endlist
|
||||
*/
|
||||
|
@@ -119,7 +119,7 @@
|
||||
\image qmldesigner-form-editor-move-cursor.png "Move cursor in Form Editor view"
|
||||
|
||||
For more information about alternative ways of positioning components in
|
||||
UIs, see \l{Positioning Items}.
|
||||
UIs, see \l{Positioning Components}.
|
||||
|
||||
\section1 Resizing 2D Components
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
\image qmldesigner-snap-margins.png "Snapping lines on canvas"
|
||||
|
||||
For alternative ways of aligning and distributing components by using the
|
||||
\l Properties view, see \l{Aligning and Distributing Items}.
|
||||
\l Properties view, see \l{Aligning and Distributing Components}.
|
||||
|
||||
\section1 Hiding Component Boundaries
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -35,20 +35,20 @@
|
||||
|
||||
\title Loading Placeholder Data
|
||||
|
||||
The Design mode supports views, models, and delegates, so that when you add
|
||||
a Grid View, List View, or Path View item, the ListModel and the delegate
|
||||
item are added automatically.
|
||||
\QC supports views, models, and delegates, so that when you add
|
||||
a Grid View, List View, or Path View component, the ListModel and
|
||||
the delegate component are added automatically.
|
||||
|
||||
However, the missing context of the application presents a challenge.
|
||||
Specific models defined in C++ are the most obvious case. Often,
|
||||
the context is missing simple properties, which are either defined in C++,
|
||||
or in other QML files. A typical example is an item that uses the
|
||||
or in other component files. A typical example is a component that uses the
|
||||
properties of its parent, such as \c parent.width.
|
||||
|
||||
\section1 Using Dummy Models
|
||||
|
||||
If you open a file in the Design mode that references a C++ model, you see
|
||||
nothing on the canvas. If the data in the model is fetched from the
|
||||
If you open a file in \l {Form Editor} that references a C++ model, you see
|
||||
nothing in it. If the data in the model is fetched from the
|
||||
internet, you have no control over it. To get reliable data, \e {dummy data}
|
||||
was introduced.
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
|
||||
Create a directory named \e dummydata in the root directory of the project,
|
||||
so that it is not deployed to the device. In the \c dummydata directory,
|
||||
create a QML file that has the same name as the value of \c model:
|
||||
create a file (.qml) that has the same name as the value of \c model:
|
||||
|
||||
\code
|
||||
qml/exampleapp/example.qml
|
||||
@@ -93,7 +93,7 @@
|
||||
|
||||
\section1 Creating Dummy Context
|
||||
|
||||
The following example presents a common pattern in QML:
|
||||
The following example presents a common pattern:
|
||||
|
||||
\qml
|
||||
Item {
|
||||
@@ -102,11 +102,11 @@
|
||||
}
|
||||
\endqml
|
||||
|
||||
This works nicely for applications but the Design mode displays a zero-sized
|
||||
item. A parent for the opened file does not exist, because the context is
|
||||
missing. To get around the missing context, the idea of a \e {dummy
|
||||
context} is introduced. If you place a file with the same name as the
|
||||
application (here, example.qml) in the \c {dummydata/context} directory,
|
||||
This works nicely for applications but \uicontrol {Form Editor} displays a
|
||||
zero-sized component. A parent for the opened file does not exist, because
|
||||
the context is missing. To get around the missing context, the idea of a
|
||||
\e {dummy context} is introduced. If you place a file with the same name as
|
||||
the application (here, example.qml) in the \c {dummydata/context} directory,
|
||||
you can fake a parent context:
|
||||
|
||||
\qml
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -28,49 +28,48 @@
|
||||
\previouspage qtquick-properties.html
|
||||
\nextpage qtquick-fonts.html
|
||||
|
||||
\title Positioning Items
|
||||
\title Positioning Components
|
||||
|
||||
The position of an item in a UI can be either absolute or relative to
|
||||
other items. The visual types exist at a particular location in the screen
|
||||
coordinate system at any instant in time. The x and y coordinates of a
|
||||
visual item are relative to those of its visual parent, with the top-left
|
||||
corner having the coordinate (0, 0).
|
||||
The position of a \l{glossary-component}{component} in a UI can be either
|
||||
absolute or relative to other components. The visual components exist at a
|
||||
particular location in the screen coordinate system at any instant in time.
|
||||
The x and y coordinates of a visual component are relative to those of its
|
||||
visual parent, with the top-left corner having the coordinate (0, 0).
|
||||
|
||||
If you are designing a static UI,
|
||||
\l{Important Concepts In Qt Quick - Positioning#manual-positioning}
|
||||
{manual positioning} provides the most efficient form of positioning
|
||||
items. For a dynamic UI, you can employ the following positioning
|
||||
components. For a dynamic UI, you can employ the following positioning
|
||||
methods:
|
||||
|
||||
\list
|
||||
\li \l{Setting Bindings}
|
||||
\li \l{Setting Anchors and Margins}
|
||||
\li \l{Aligning and Distributing Items}
|
||||
\li \l{Aligning and Distributing Components}
|
||||
\li \l{Using Positioners}
|
||||
\li \l{Using Layouts}
|
||||
\li \l{Organizing Items}
|
||||
\li \l{Organizing Components}
|
||||
\endlist
|
||||
|
||||
\section2 Setting Bindings
|
||||
|
||||
\l{Positioning with Bindings} {Property binding} is a declarative way of
|
||||
\l{Positioning with Bindings}{Property binding} is a declarative way of
|
||||
specifying the value of a property. Binding allows a property value to be
|
||||
expressed as a JavaScript expression that defines the value relative to
|
||||
other property values or data accessible in the application. The property
|
||||
value is automatically kept up to date if the other properties or data
|
||||
values change.
|
||||
|
||||
Property bindings are created implicitly in QML whenever a property is
|
||||
assigned a JavaScript expression. To set JavaScript expressions as values
|
||||
of properties in the \uicontrol Properties view, select the
|
||||
\inlineimage icons/action-icon.png
|
||||
Property bindings are created implicitly whenever a property is assigned a
|
||||
JavaScript expression. To set JavaScript expressions as values of properties
|
||||
in the \l Properties view, select the \inlineimage icons/action-icon.png
|
||||
(\uicontrol Actions) menu next to a property, and then select
|
||||
\uicontrol {Set Binding}.
|
||||
|
||||
\image qmldesigner-set-expression.png "Type properties context menu"
|
||||
\image qmldesigner-set-expression.png "Actions menu"
|
||||
|
||||
In \uicontrol {Binding Editor}, select an item and a property from
|
||||
lists of available items and their properties.
|
||||
In \uicontrol {Binding Editor}, select a component and a property from
|
||||
lists of available components and their properties.
|
||||
|
||||
\image qmldesigner-binding-editor.png "Binding Editor"
|
||||
|
||||
@@ -84,58 +83,58 @@
|
||||
\inlineimage icons/action-icon-binding
|
||||
. To remove bindings, select \uicontrol Actions > \uicontrol Reset.
|
||||
|
||||
You can set bindings also in the \uicontrol Connections view. For more
|
||||
You can set bindings also in the \l Connections view. For more
|
||||
information, see \l {Adding Bindings Between Properties}.
|
||||
|
||||
For more information on the JavaScript environment provided by QML, see
|
||||
For more information on the JavaScript environment provided, see
|
||||
\l{Integrating QML and JavaScript}.
|
||||
|
||||
Bindings are a black box for \QC and using them might have a
|
||||
negative impact on performance, so consider setting anchors and margins for
|
||||
items, instead. For example, instead of setting \c {parent.width} for an
|
||||
item, you could anchor the item to its sibling items on the left and the
|
||||
right.
|
||||
components, instead. For example, instead of setting \c {parent.width} for a
|
||||
component, you could anchor the component to its sibling components on the
|
||||
left and the right.
|
||||
|
||||
\section2 Setting Anchors and Margins
|
||||
|
||||
In an \l{Important Concepts In Qt Quick - Positioning#anchors}
|
||||
{anchor-based} layout, each QML type can be thought of as having a set of
|
||||
{anchor-based} layout, each component can be thought of as having a set of
|
||||
invisible \e anchor lines: top, bottom, left, right, fill, horizontal
|
||||
center, vertical center, and baseline.
|
||||
|
||||
In the \uicontrol Layout tab you can set anchors and margins for items. To
|
||||
set the anchors of an item, click the anchor buttons. You can combine the
|
||||
top/bottom, left/right, and horizontal/vertical anchors to anchor items in
|
||||
the corners of the parent item or center them horizontally or vertically
|
||||
within the parent item.
|
||||
In \l Properties > \uicontrol Layout, you can set anchors and margins for
|
||||
components. To set the anchors of a component, click the anchor buttons.
|
||||
You can combine the top/bottom, left/right, and horizontal/vertical anchors
|
||||
to anchor components in the corners of the parent component or center them
|
||||
horizontally or vertically within the parent component.
|
||||
|
||||
\image qmldesigner-anchor-buttons.png "Anchor buttons"
|
||||
|
||||
For convenience, you can click the \inlineimage icons/anchor-fill.png
|
||||
(\uicontrol {Fill to Parent}) toolbar button to apply fill anchors to an
|
||||
item and the \inlineimage qtcreator-anchors-reset-icon.png
|
||||
(\uicontrol {Fill to Parent}) toolbar button to apply fill anchors to a
|
||||
component and the \inlineimage qtcreator-anchors-reset-icon.png
|
||||
(\uicontrol {Reset Anchors}) button to reset the anchors to their saved
|
||||
state.
|
||||
|
||||
You can specify the baseline anchor in \uicontrol {Text Editor}.
|
||||
|
||||
For performance reasons, you can only anchor an item to its siblings
|
||||
and direct parent. By default, an item is anchored to its parent when
|
||||
you use the anchor buttons. Select a sibling of the item in the
|
||||
\uicontrol Target field to anchor to it, instead.
|
||||
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
|
||||
you use the anchor buttons. Select a sibling of the component in the
|
||||
\uicontrol Target field to anchor to it instead.
|
||||
|
||||
Arbitrary anchoring is not supported. For example, you cannot specify:
|
||||
\c {anchor.left: parent.right}. You have to specify:
|
||||
\c {anchor.left: parent.left}. When you use the anchor buttons, anchors to
|
||||
the parent item are always specified to the same side. However, anchors to
|
||||
sibling items are specified to the opposite side:
|
||||
\c {anchor.left: sibling.right}. This allows you to keep sibling items
|
||||
the parent component are always specified to the same side. However, anchors
|
||||
to sibling components are specified to the opposite side:
|
||||
\c {anchor.left: sibling.right}. This allows you to keep sibling components
|
||||
together.
|
||||
|
||||
In the following image, \uicontrol{Rectangle 2} is anchored to
|
||||
\uicontrol {Rectangle 1} on its left and to the bottom of its parent.
|
||||
|
||||
\image qmldesigner-anchors.png "Anchoring sibling items"
|
||||
\image qmldesigner-anchors.png "Anchoring sibling components"
|
||||
|
||||
The anchors for \uicontrol{Rectangle 2} are specified as follows in code:
|
||||
|
||||
@@ -150,109 +149,110 @@
|
||||
}
|
||||
\endqml
|
||||
|
||||
Margins specify the amount of empty space to leave to the outside of an
|
||||
item. Margins only have meaning for anchors. They do not take any effect
|
||||
when using layouts or absolute positioning.
|
||||
Margins specify the amount of empty space to leave to the outside of a
|
||||
component. Margins only have meaning for anchors. They do not take any
|
||||
effect when using layouts or absolute positioning.
|
||||
|
||||
\section2 Aligning and Distributing Items
|
||||
\section2 Aligning and Distributing Components
|
||||
|
||||
When you're working with a group of items, you can select them to align
|
||||
and distribute them evenly. As the positions of the items are fixed, you
|
||||
cannot apply these functions to anchored items. For scalability, you can
|
||||
anchor the aligned and distributed items when your design is ready.
|
||||
When you're working with a group of components, you can select them to align
|
||||
and distribute them evenly. As the positions of the components are fixed,
|
||||
you cannot apply these functions to anchored components. For scalability,
|
||||
you can anchor the aligned and distributed components when your design is
|
||||
ready.
|
||||
|
||||
\image qmldesigner-alignment.png "Aligning sibling items"
|
||||
\image qmldesigner-alignment.png "Aligning sibling components"
|
||||
|
||||
Select the buttons in the \uicontrol Align group to align the top/bottom
|
||||
or left/right edges of the items in the group to the one farthest away from
|
||||
the center of the group. For example, when left-aligning, the items are
|
||||
aligned to the leftmost item. You can also align the horizontal/vertical
|
||||
centers of items, or both, as in the image above.
|
||||
or left/right edges of the components in the group to the one farthest away
|
||||
from the center of the group. For example, when left-aligning, the
|
||||
components are aligned to the leftmost component. You can also align the
|
||||
horizontal/vertical centers of components, or both, as in the image above.
|
||||
|
||||
In the \uicontrol {Align to} field, select whether to align the items in
|
||||
respect to the selection, the root item, or a \e {key object} that you
|
||||
select in the \uicontrol {Key object} field. The key object must be a part
|
||||
of the selection.
|
||||
In the \uicontrol {Align to} field, select whether to align the components
|
||||
in respect to the selection, the root component, or a \e {key component}
|
||||
that you select in the \uicontrol {Key object} field. The key component must
|
||||
be a part of the selection.
|
||||
|
||||
You can distribute either \e objects or the \e spacing between them. If the
|
||||
objects or spacing cannot be distributed to equal pixel values without
|
||||
ending up with half pixels, you receive a notification. You can either allow
|
||||
\QDS to distribute objects or spacing using the closest values possible or
|
||||
tweak your design so that the objects and spacing can be distributed
|
||||
perfectly.
|
||||
You can distribute either \e components or the \e spacing between them.
|
||||
If the components or spacing cannot be distributed to equal pixel values
|
||||
without ending up with half pixels, you receive a notification. You can
|
||||
either allow \QDS to distribute components or spacing using the closest
|
||||
values possible or tweak your design so that the components and spacing
|
||||
can be distributed perfectly.
|
||||
|
||||
When distributing objects, you can select whether the distance between
|
||||
When distributing components, you can select whether the distance between
|
||||
them is calculated from their top/bottom or left/right edges or their
|
||||
horizontal/vertical center.
|
||||
|
||||
\image qmldesigner-distribute-objects.png "Distribute objects buttons"
|
||||
\image qmldesigner-distribute-objects.png "Distribute components buttons"
|
||||
|
||||
You can distribute spacing either evenly within a target area or at
|
||||
specified distances, calculated from a starting point.
|
||||
|
||||
You can select the orientation in which the objects are distributed evenly
|
||||
within the target area: horizontally along the x axis or vertically along
|
||||
the y axis.
|
||||
You can select the orientation in which the components are distributed
|
||||
evenly within the target area: horizontally along the x axis or vertically
|
||||
along the y axis.
|
||||
|
||||
\image qmldesigner-distribute-spacing-evenly.png "Distribute spacing evenly"
|
||||
|
||||
Alternatively, you can distribute spacing in pixels by selecting one of the
|
||||
starting point buttons: left/right or top/bottom edge of the target area,
|
||||
or its horizontal/vertical center. Note that some items might end up outside
|
||||
the target area.
|
||||
or its horizontal/vertical center. Note that some components might end up
|
||||
outside the target area.
|
||||
|
||||
\image qmldesigner-distribute-spacing-pixels.png "Distribute spacing in pixels"
|
||||
|
||||
You can set the space between objects in pixels. You can
|
||||
You can set the space between components in pixels. You can
|
||||
disable the distribution of spacing in pixels by clicking
|
||||
the \inlineimage icons/distribute-origin-none.png
|
||||
button.
|
||||
|
||||
\section2 Using Positioners
|
||||
|
||||
Positioner items are container items that manage the positions of
|
||||
items. For many use cases, the best positioner to use is a simple
|
||||
column, row, flow, or grid. You can use the QML types available in
|
||||
the \uicontrol {Qt Quick - Positioner} section of \uicontrol Library
|
||||
to position the children of an item in these formations in the most
|
||||
efficient manner possible.
|
||||
Positioner components are containers that manage the positions of their
|
||||
child components. For many use cases, the best positioner to use is a simple
|
||||
column, row, flow, or grid. You can use the components available in
|
||||
\l Library > \uicontrol Components > \uicontrol {Default Components} >
|
||||
\uicontrol Positioner to position the children of a component in these
|
||||
formations in the most efficient manner possible.
|
||||
|
||||
To position several items in a \uicontrol Column, \uicontrol Row,
|
||||
\uicontrol Flow, or \uicontrol Grid, select the items in
|
||||
\uicontrol {Form Editor}, and then select \uicontrol Position in
|
||||
To position several components in a \uicontrol Column, \uicontrol Row,
|
||||
\uicontrol Flow, or \uicontrol Grid, select the components in
|
||||
\l {Form Editor}, and then select \uicontrol Position in
|
||||
the context menu.
|
||||
|
||||
\section3 Column Positioner
|
||||
|
||||
A \uicontrol Column positions its child items along a single column.
|
||||
A \uicontrol Column positions its child components along a single column.
|
||||
It can be used as a convenient way to vertically position a series of
|
||||
items without using anchors.
|
||||
components without using anchors.
|
||||
|
||||
\image qtquick-positioner-column-properties.png "Column properties"
|
||||
|
||||
For all positioners, you can specify the spacing between the child
|
||||
items that they contain in the \uicontrol Spacing field.
|
||||
components that they contain in the \uicontrol Spacing field.
|
||||
|
||||
In addition, you can specify the vertical and horizontal padding between
|
||||
content and the left, right, top, and bottom edges of items as values of
|
||||
the fields in the \uicontrol Padding group.
|
||||
content and the left, right, top, and bottom edges of components as values
|
||||
of the fields in the \uicontrol Padding group.
|
||||
|
||||
\section3 Row and Flow Positioners
|
||||
|
||||
A \uicontrol Row positions its child items along a single row. It can be
|
||||
used as a convenient way to horizontally position a series of items without
|
||||
using anchors.
|
||||
A \uicontrol Row positions its child components along a single row. It can
|
||||
be used as a convenient way to horizontally position a series of components
|
||||
without using anchors.
|
||||
|
||||
The \uicontrol Flow type positions its child items like words on a page,
|
||||
wrapping them to create rows or columns of items.
|
||||
The \uicontrol Flow component positions its child components like words on a
|
||||
page, wrapping them to create rows or columns of components.
|
||||
|
||||
\image qtquick-positioner-flow-properties.png "Flow properties"
|
||||
|
||||
For flow and row positioners, you can also set the direction of a flow to
|
||||
either left-to-right or top-to-bottom in the \uicontrol Flow field.
|
||||
Items are positioned next to to each other according to the value you set
|
||||
in the \uicontrol {Layout direction} field until the width or height of the
|
||||
Flow item is exceeded, then wrapped to the next row or column.
|
||||
Components are positioned next to to each other according to the value you
|
||||
set in the \uicontrol {Layout direction} field until the width or height of
|
||||
the Flow component is exceeded, then wrapped to the next row or column.
|
||||
|
||||
You can set the layout direction to either \uicontrol LeftToRight or
|
||||
\uicontrol RightToLeft in the \uicontrol {Layout direction} field. If
|
||||
@@ -262,31 +262,31 @@
|
||||
\section3 Grid Positioner
|
||||
|
||||
A \uicontrol Grid creates a grid of cells that is large enough to hold all
|
||||
of its child items, and places these items in the cells from left to right
|
||||
and top to bottom. Each item is positioned at the top-left corner of its
|
||||
cell with position (0, 0).
|
||||
of its child components, and places these components in the cells from left
|
||||
to right and top to bottom. Each component is positioned at the top-left
|
||||
corner of its cell with position (0, 0).
|
||||
|
||||
\QC generates the grid based on the positions of the child items in
|
||||
\uicontrol {Form Editor}. You can modify the number of rows and columns
|
||||
in the \uicontrol Rows and \uicontrol Columns fields.
|
||||
\QC generates the grid based on the positions of the child components in
|
||||
\l {Form Editor}. You can modify the number of rows and columns in the
|
||||
\uicontrol Rows and \uicontrol Columns fields.
|
||||
|
||||
\image qtquick-positioner-grid-properties.png "Grid properties"
|
||||
|
||||
In addition to the flow and layout direction, you can set the horizontal
|
||||
and vertical alignment of grid items. By default, grid items are vertically
|
||||
aligned to the top. Horizontal alignment follows the value of the
|
||||
and vertical alignment of grid components. By default, grid components are
|
||||
vertically aligned to the top. Horizontal alignment follows the value of the
|
||||
\uicontrol {Layout direction} field. For example, when layout direction is
|
||||
set to \uicontrol LeftToRight, the items are aligned on the left.
|
||||
set to \uicontrol LeftToRight, the components are aligned on the left.
|
||||
|
||||
To mirror the layout, set the layout direction to \uicontrol RightToLeft.
|
||||
To also mirror the horizontal alignment of items, select
|
||||
To also mirror the horizontal alignment of components, select
|
||||
\uicontrol AlignRight in the \uicontrol {Horizontal item alignment} field.
|
||||
|
||||
\section3 Summary of Positioners
|
||||
|
||||
The following table lists the positioners that you can use to arrange items
|
||||
in UIs. They are available in the \uicontrol {Qt Quick - Positioner} section
|
||||
of \uicontrol Library.
|
||||
The following table lists the positioners that you can use to arrange
|
||||
components in UIs. They are available in \l Library > \uicontrol Components
|
||||
> \uicontrol {Default Components} > \uicontrol Positioner.
|
||||
|
||||
\table
|
||||
\header
|
||||
@@ -296,84 +296,85 @@
|
||||
\row
|
||||
\li \inlineimage column-positioner-icon-16px.png
|
||||
\li \l[QtQuick] {Column}
|
||||
\li Arranges its child items vertically.
|
||||
\li Arranges its child components vertically.
|
||||
\row
|
||||
\li \inlineimage row-positioner-icon-16px.png
|
||||
\li \l[QtQuick] {Row}
|
||||
\li Arranges its child items horizontally.
|
||||
\li Arranges its child components horizontally.
|
||||
\row
|
||||
\li \inlineimage grid-positioner-icon-16px.png
|
||||
\li \l[QtQuick] {Grid}
|
||||
\li Arranges its child items so that they are aligned in a grid and
|
||||
\li Arranges its child components so that they are aligned in a grid and
|
||||
are not overlapping.
|
||||
\row
|
||||
\li \inlineimage flow-positioner-icon-16px.png
|
||||
\li \l[QtQuick] {Flow}
|
||||
\li Arranges its child items side by side, wrapping as necessary.
|
||||
\li Arranges its child components side by side, wrapping as necessary.
|
||||
\endtable
|
||||
|
||||
\section2 Using Layouts
|
||||
|
||||
\if defined(qtcreator)
|
||||
Since Qt 5.1, you can use QML types in the \l{qtquicklayouts-index.html}
|
||||
{Qt Quick Layouts} module to arrange items in UIs.
|
||||
{Qt Quick Layouts} module to arrange components in UIs.
|
||||
\else
|
||||
You can use the QML types available in the \uicontrol {Qt Quick - Layouts}
|
||||
section of \uicontrol Library to arrange items in UIs.
|
||||
You can use the components available in \l Library > \uicontrol Components
|
||||
> \uicontrol {Qt Quick Layouts} to arrange components in UIs.
|
||||
\endif
|
||||
Unlike positioners, layouts manage both the positions and sizes of their
|
||||
child items, and are therefore well suited for dynamic and resizable UIs.
|
||||
However, this means that you should not specify fixed positions and sizes
|
||||
for the child items in the \uicontrol Geometry group in their properties,
|
||||
unless their implicit sizes are not satisfactory.
|
||||
child components, and are therefore well suited for dynamic and resizable
|
||||
UIs. However, this means that you should not specify fixed positions and
|
||||
sizes for the child components in the \l{2D Geometry}{Geometry} group in
|
||||
\l Properties, unless their implicit sizes are not satisfactory.
|
||||
|
||||
You can use anchors or the width and height properties of the layout itself
|
||||
to specify its size in respect to its non-layout parent item. However, do
|
||||
not anchor the child items within layouts.
|
||||
to specify its size in respect to its non-layout parent component. However,
|
||||
do not anchor the child components within layouts.
|
||||
|
||||
To arrange several items in a column, row, grid, or
|
||||
\uicontrol {Stack Layout}, select the items in \uicontrol {Form Editor},
|
||||
To arrange several components in a column, row, grid, or
|
||||
\uicontrol {Stack Layout}, select the components in \l {Form Editor},
|
||||
and then select \uicontrol Layout in the context menu.
|
||||
|
||||
You can also click the \inlineimage column.png
|
||||
(\uicontrol {Column Layout}), \inlineimage row.png
|
||||
(\uicontrol {Row Layout}), and \inlineimage grid.png
|
||||
(\uicontrol {Grid Layout}) toolbar buttons to apply
|
||||
layouts to the selected items.
|
||||
layouts to the selected components.
|
||||
|
||||
To make an item within a layout as wide as possible while respecting the
|
||||
given constraints, select the item in \uicontrol {Form Editor}, and then
|
||||
select \uicontrol Layout > \uicontrol {Fill Width} in the context menu. To
|
||||
make the item as high as possible, select \uicontrol {Fill Height}.
|
||||
To make a component within a layout as wide as possible while respecting the
|
||||
given constraints, select the component in \uicontrol {Form Editor}, and
|
||||
then select \uicontrol Layout > \uicontrol {Fill Width} in the context menu.
|
||||
To make the component as high as possible, select \uicontrol {Fill Height}.
|
||||
|
||||
\section3 Layout Properties
|
||||
|
||||
A \uicontrol {Grid Layout} type provides a way of dynamically arranging
|
||||
items in a grid. If the grid layout is resized, all its child items are
|
||||
rearranged. If you want a layout with just one row or one column, use the
|
||||
\uicontrol {Row Layout} or \uicontrol {Column Layout} type.
|
||||
A \uicontrol {Grid Layout} component provides a way of dynamically
|
||||
arranging components in a grid. If the grid layout is resized, all
|
||||
its child components are rearranged. If you want a layout with just
|
||||
one row or one column, use the \uicontrol {Row Layout} or
|
||||
\uicontrol {Column Layout} component.
|
||||
|
||||
The child items of row and column layout items are automatically positioned
|
||||
either horizontally from left to right as rows or vertically from
|
||||
top to bottom as columns. The number of the child items determines the width
|
||||
of the row or the height of the column. You can specify the spacing between
|
||||
the child items in the \uicontrol Spacing field.
|
||||
The child components of row and column layout components are automatically
|
||||
positioned either horizontally from left to right as rows or vertically from
|
||||
top to bottom as columns. The number of the child components determines the
|
||||
width of the row or the height of the column. You can specify the spacing
|
||||
between the child components in the \uicontrol Spacing field.
|
||||
|
||||
The child items of grid layout items are arranged according to the
|
||||
The child components of grid layout components are arranged according to the
|
||||
\uicontrol Flow property. When the direction of a flow is set to
|
||||
\uicontrol LeftToRight, child items are positioned next to to each
|
||||
\uicontrol LeftToRight, child components are positioned next to to each
|
||||
other until the the number of \uicontrol Columns is reached. Then,
|
||||
the auto-positioning wraps back to the beginning of the next row.
|
||||
|
||||
\image qtquick-layout-grid-properties.png "Grid Layout properties"
|
||||
|
||||
If you set the direction of the flow to \uicontrol TopToBottom, child
|
||||
items are auto-positioned vertically using the value of the \uicontrol Rows
|
||||
field to determine the maximum number of rows.
|
||||
components are auto-positioned vertically using the value of the
|
||||
\uicontrol Rows field to determine the maximum number of rows.
|
||||
|
||||
You can set the layout direction to either \uicontrol LeftToRight or
|
||||
\uicontrol RightToLeft in the \uicontrol {Layout direction} field.
|
||||
When you select \uicontrol RightToLeft, the alignment of the items
|
||||
When you select \uicontrol RightToLeft, the alignment of the components
|
||||
will be mirrored.
|
||||
|
||||
You can specify the spacing between rows and columns in the
|
||||
@@ -383,25 +384,25 @@
|
||||
|
||||
\image qtquick-designer-stacked-view.png
|
||||
|
||||
To add items to a \uicontrol {Stack Layout}, select the
|
||||
To add components to a \uicontrol {Stack Layout}, select the
|
||||
\inlineimage plus.png
|
||||
button next to the type name in \uicontrol {Form Editor}. To move
|
||||
between items, select the \inlineimage prev.png
|
||||
button next to the component name in \l {Form Editor}.
|
||||
To move between components, select the \inlineimage prev.png
|
||||
(\uicontrol Previous) and \inlineimage next.png
|
||||
(\uicontrol Next) buttons.
|
||||
|
||||
To add a tab bar to a stack layout, select \uicontrol {Stacked Container} >
|
||||
\uicontrol {Add Tab Bar}.
|
||||
|
||||
To raise or lower the stacking order of an item, select
|
||||
To raise or lower the stacking order of a component, select
|
||||
\uicontrol {Stacked Container} > \uicontrol {Increase Index} or
|
||||
\uicontrol {Decrease Index}.
|
||||
|
||||
\section3 Summary of Layouts
|
||||
|
||||
The following table lists the layout types that you can use to arrange items
|
||||
in UIs. They are available in the \uicontrol {Qt Quick - Layouts} section
|
||||
of \uicontrol Library.
|
||||
The following table lists the layout components that you can use to arrange
|
||||
components in UIs. They are available in \l Library > \uicontrol Components
|
||||
> \uicontrol {Qt Quick Layouts}.
|
||||
|
||||
\table
|
||||
\header
|
||||
@@ -419,19 +420,20 @@
|
||||
\row
|
||||
\li \inlineimage grid-layouts-icon-16px.png
|
||||
\li \l{GridLayout}{Grid Layout}
|
||||
\li Provides a way of dynamically arranging items in a grid.
|
||||
\li Provides a way of dynamically arranging components in a grid.
|
||||
\row
|
||||
\li \inlineimage stack-layouts-icon-16px.png
|
||||
\li \l{StackLayout}{Stack Layout}
|
||||
\li Provides a stack of items where only one item is visible at a time.
|
||||
\li Provides a stack of components where only one component is
|
||||
visible at a time.
|
||||
\endtable
|
||||
|
||||
|
||||
\section2 Organizing Items
|
||||
\section2 Organizing Components
|
||||
|
||||
The following table lists the UI controls that you can use to
|
||||
organize items in UIs (since Qt 5.7). They are available in the
|
||||
\uicontrol {Qt Quick - Controls 2} section of \uicontrol Library.
|
||||
organize components in UIs (since Qt 5.7). They are available in
|
||||
\l Library > \uicontrol Components > \uicontrol {Qt Quick Controls}.
|
||||
|
||||
\table
|
||||
\header
|
||||
|
@@ -158,6 +158,6 @@
|
||||
\l{Specifying Component Properties}.
|
||||
\li For more information on the properties available for a
|
||||
component, press \key {F1} or see \l{Component Types}
|
||||
and \l{Positioning Items}.
|
||||
and \l{Positioning Components}.
|
||||
\endlist
|
||||
*/
|
||||
|
@@ -76,7 +76,7 @@
|
||||
In the \uicontrol Position group, you can set the position of a component on
|
||||
the x and y axis. The position of a component in the UI can be either
|
||||
absolute or relative to other components. For more information, see
|
||||
\l{Positioning Items}.
|
||||
\l{Positioning Components}.
|
||||
|
||||
In the 2D space, the z position of a component determines its position in
|
||||
relation to its sibling components in the component hierarchy. You can set
|
||||
@@ -85,7 +85,7 @@
|
||||
In the \uicontrol Size group, you can set the width and height of a
|
||||
component. You can also use the resize cursor to \l{Resizing 2D Components}
|
||||
{resize 2D components} in \uicontrol {Form Editor} or the scaling gizmo
|
||||
to \l{Scaling Items}{scale 3D components} in \uicontrol {3D Editor}.
|
||||
to \l{Scaling Components}{scale 3D components} in \uicontrol {3D Editor}.
|
||||
The values in the \uicontrol X and \uicontrol Y fields change accordingly.
|
||||
|
||||
The component size and position can also be managed automatically
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Creator documentation.
|
||||
@@ -38,13 +38,12 @@
|
||||
\endif
|
||||
\nextpage qtquick-adding-dynamics.html
|
||||
|
||||
\title Qt Quick UI Forms
|
||||
\title UI Files
|
||||
|
||||
You can use \QC wizards to create UI forms that have the filename extension
|
||||
\e .ui.qml. The UI forms contain a purely declarative subset of the QML
|
||||
language. It is recommended that you edit the forms in the \uicontrol Design mode.
|
||||
\QC enforces the use of the supported QML features by displaying error
|
||||
messages.
|
||||
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
|
||||
by \uicontrol {Form Editor}, \QC displays error messages.
|
||||
|
||||
The following features are not supported:
|
||||
|
||||
@@ -52,11 +51,12 @@
|
||||
\li JavaScript blocks
|
||||
\li Other bindings than pure expressions
|
||||
\li Signal handlers
|
||||
\li States in other items than the root item
|
||||
\li Root items that are not derived from \l QQuickItem or \l [QML]{Item}
|
||||
\li States in other components than the root component
|
||||
\li Root components that are not derived from \l QQuickItem or
|
||||
\l [QML]{Item}
|
||||
\endlist
|
||||
|
||||
The following types are not supported:
|
||||
The following components are not supported:
|
||||
|
||||
\list
|
||||
\li Behavior
|
||||
@@ -161,11 +161,11 @@
|
||||
For more information about using the methods, see
|
||||
\l{https://doc.qt.io/qt/qml-qtqml-qt.html}{Qt QML Methods}.
|
||||
|
||||
\section1 Using Qt Quick UI Forms
|
||||
\section1 Using UI Files
|
||||
|
||||
You can edit the forms in the \uicontrol {Form Editor} and
|
||||
\uicontrol {Text Editor} tabs in the \uicontrol Design mode. Items that are
|
||||
supposed to be used in QML code have to be exported as properties:
|
||||
You can edit the UI files in the \l {Form Editor} and
|
||||
\uicontrol {Text Editor} views. Components that are
|
||||
supposed to be used in code have to be exported as properties:
|
||||
|
||||
\code
|
||||
Item {
|
||||
@@ -182,17 +182,16 @@
|
||||
}
|
||||
\endcode
|
||||
|
||||
The property alias exports the button to the QML code that uses the form.
|
||||
You can use the
|
||||
\inlineimage export_checked.png
|
||||
(\uicontrol Export) button in the \uicontrol Navigator to export an item as
|
||||
a property:
|
||||
The property alias exports the button to the code that uses the form.
|
||||
You can use the \inlineimage export_unchecked.png
|
||||
(\uicontrol Export) button in \l Navigator to export a component
|
||||
as a property:
|
||||
|
||||
\image qmldesigner-export-item.png
|
||||
|
||||
In the QML file that uses the form, you can use the \c button property alias
|
||||
to implement signal handlers, for example. In the following code snippet,
|
||||
the UI form is called \e MainForm.ui.qml:
|
||||
In the UI file where the component is used, you can use the \c button
|
||||
property alias to implement signal handlers, for example. In the
|
||||
following code snippet, the UI file is called \e MainForm.ui.qml:
|
||||
|
||||
\code
|
||||
MainForm {
|
||||
@@ -203,8 +202,9 @@
|
||||
|
||||
You can also assign properties or define behavior or transitions.
|
||||
|
||||
To move from the \uicontrol Design mode directly to the implementation of a
|
||||
type in the .qml file, right-click the type in the \uicontrol Navigator and
|
||||
select \uicontrol {Go to Implementation} in the context menu.
|
||||
To move from \l {Form Editor} or \l Navigator directly to the
|
||||
implementation of a component in the .qml file, right-click the
|
||||
component and select \uicontrol {Go to Implementation} in the
|
||||
context menu.
|
||||
|
||||
*/
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 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.
|
||||
@@ -36,27 +36,24 @@
|
||||
\title Creating UIs
|
||||
|
||||
\if defined(qtdesignstudio)
|
||||
When you install \QDS, everything you'll need to design UIs
|
||||
using \l{Qt Quick} and to preview them on the desktop or on Android or
|
||||
embedded Linux devices is automatically installed and configured correctly
|
||||
for you.
|
||||
When you install \QDS, everything you'll need to design UIs and to preview
|
||||
them on the desktop or embedded Linux devices is automatically installed
|
||||
and configured correctly for you.
|
||||
\endif
|
||||
|
||||
Qt Quick enables you to build UIs around the behavior of \e components and
|
||||
how they connect with one another. You create components using Qt Quick and
|
||||
QML types that are available in the \uicontrol Library view in the Design
|
||||
mode. You can specify values for the \e properties of a
|
||||
component to change its appearance and behavior. All QML types have a
|
||||
In \QC, you build UIs around the behavior of \l{glossary-component}
|
||||
{components} and how they connect with one another. You can use preset
|
||||
components available in the \l Library view or combine them to create
|
||||
your own components. You can specify values for the \e properties of a
|
||||
component to change its appearance and behavior. All components have a
|
||||
set of predefined properties, some of which control things that are
|
||||
visible to users, while others are used behind the scene.
|
||||
|
||||
While it is useful to learn the basics of Qt Quick, you can also rely on
|
||||
\QMLD to write the code for you when you drag-and-drop the ready-made
|
||||
components from the \uicontrol Library view to the \uicontrol {Form Editor}
|
||||
or \uicontrol Navigator view and change them to your liking by modifying
|
||||
their properties in the \uicontrol Properties view.
|
||||
You can always check up details in the extensive Qt Quick
|
||||
documentation by pressing \key F1.
|
||||
When you drag-and-drop the preset components from the \uicontrol Library
|
||||
view to the \l {Form Editor} or \l Navigator view and change them to your
|
||||
liking by modifying their properties in the \l Properties view, the
|
||||
application code is generated for you accordingly. For more information
|
||||
about the code, open the developer documentation by pressing \key F1.
|
||||
|
||||
\list
|
||||
|
||||
@@ -72,35 +69,31 @@
|
||||
|
||||
\li \l {Creating Components}
|
||||
|
||||
You can enhance imported designs by customizing ready-made
|
||||
You can enhance imported designs by customizing preset
|
||||
components or design custom forms and shapes directly as
|
||||
QML types. You can import visual assets in various formats,
|
||||
components. You can import visual assets in various formats,
|
||||
such as PNG, JPG, and SVG for use in the components.
|
||||
|
||||
\li \l {Navigator}
|
||||
|
||||
You can manage the items in the current QML file and their
|
||||
relationships in the \uicontrol Navigator view.
|
||||
|
||||
\li \l {Specifying Component Properties}
|
||||
|
||||
You can specify values for the properties of a component to change
|
||||
its appearance and behavior. All QML types have a set of predefined
|
||||
its appearance and behavior. All components have a set of predefined
|
||||
properties. Some properties, such as position, size, and visibility,
|
||||
are common to all QML types, whereas others are specific to the QML
|
||||
type. You can specify properties for your components in the
|
||||
\uicontrol Properties view.
|
||||
are common to all components, whereas others are specific to the
|
||||
component. You can specify properties for your components in the
|
||||
\l Properties view.
|
||||
|
||||
\li \l {Positioning Items}
|
||||
\li \l {Positioning Components}
|
||||
|
||||
The position of an item in a UI can be either absolute or relative
|
||||
to other items. While manual positioning is efficient for a static
|
||||
UI, consider the other available method, such as anchors, layouts,
|
||||
positioners, and property bindings, for dynamic UIs.
|
||||
The position of a component in a UI can be either absolute
|
||||
or relative to other components. While manual positioning
|
||||
is efficient for a static UI, consider the other available
|
||||
methods, such as anchors, layouts, positioners, and property
|
||||
bindings, for dynamic UIs.
|
||||
|
||||
\li \l {Using Custom Fonts}
|
||||
|
||||
You can load custom fonts to \QMLD and use them in your designs.
|
||||
You can load custom fonts to \QC and use them in your designs.
|
||||
|
||||
\li \l {Annotating Designs}
|
||||
|
||||
@@ -123,10 +116,10 @@
|
||||
|
||||
\list
|
||||
\endif
|
||||
\li \l{Qt Quick UI Forms}
|
||||
\li \l{UI Files}
|
||||
|
||||
Some of the wizards create Qt Quick projects that contain UI forms
|
||||
(.ui.qml files). The forms use a purely declarative subset of the
|
||||
QML language and you can edit them in the Design mode.
|
||||
Some of the wizards create projects that contain UI files
|
||||
(.ui.qml). You should always edit UI files in \l{Form Editor}
|
||||
and \l Properties, to avoid breaking the code.
|
||||
\endlist
|
||||
*/
|
||||
|
@@ -87,45 +87,45 @@
|
||||
in the Design mode. For more information about moving views around,
|
||||
see \l {Managing Workspaces}.
|
||||
|
||||
\section2 Learn Qt Quick - Projects and Files
|
||||
\section2 Learn More - Projects and Files
|
||||
|
||||
\QDS creates a set of boilerplate files and folders that you need to create
|
||||
a UI using Qt Quick and QML. The files are listed in the \uicontrol Projects
|
||||
view. For more information, see \l {Viewing Project Files}.
|
||||
a UI. The files are listed in the \uicontrol Projects view. For more
|
||||
information, see \l {Viewing Project Files}.
|
||||
|
||||
\image loginui1-project-files.png
|
||||
|
||||
\list
|
||||
\li The \e {loginui1.qmlproject} project file defines that all
|
||||
QML, JavaScript, and image files in the project folder belong to
|
||||
the project. Therefore, you do not need to individually list new
|
||||
component, JavaScript, and image files in the project folder belong
|
||||
to the project. Therefore, you do not need to individually list new
|
||||
files when you add them to the project.
|
||||
\li The \e {loginui1.qml} file defines the functionality of
|
||||
the UI. For the time being, it does not do anything.
|
||||
\li The \e {Screen01.ui.qml} file defines the appearance of the
|
||||
UI. For more information, see \l {Qt Quick UI Forms}.
|
||||
UI. For more information, see \l {UI Files}.
|
||||
\li The \e {qtquickcontrols2.conf} file specifies the selected
|
||||
\l {Styling Qt Quick Controls}{UI style} and some style-specific
|
||||
arguments.
|
||||
\li The \e imports folder contains a \e {Constants.qml} file that
|
||||
specifies a font loader for the Arial font and a \e qmldir module
|
||||
definition file that declares the Constant QML type. For more
|
||||
definition file that declares the Constant component. For more
|
||||
information, see \l {Module Definition qmldir Files}. In addition,
|
||||
the \e QtQuick subfolder contains the Studio components and effects
|
||||
QML types. You can ignore the subfolder for now, because it is not
|
||||
components. You can ignore the subfolder for now, because it is not
|
||||
used in this tutorial.
|
||||
\endlist
|
||||
|
||||
QML files define a hierarchy of objects with a highly-readable, structured
|
||||
layout. Every QML file consists of two parts: an imports section and an
|
||||
object declaration section. The QML types and functionality most common to
|
||||
UIs are provided in the QtQuick import. You can view the QML code of an
|
||||
ui.qml file in the \uicontrol {Text Editor} view.
|
||||
UI files define a hierarchy of components with a highly-readable, structured
|
||||
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.
|
||||
|
||||
For more information about creating a QML file from scratch, see
|
||||
For more information about creating a component file from scratch, see
|
||||
\l{First Steps with QML}.
|
||||
|
||||
Next, you will edit the values of the properties of the UI elements to
|
||||
Next, you will edit the values of the properties of the UI components to
|
||||
create the main page of the UI.
|
||||
|
||||
\section1 Creating the Main Page
|
||||
|
@@ -71,7 +71,7 @@
|
||||
change for the animation.
|
||||
|
||||
For more information about creating and positioning components, see
|
||||
\l {Creating Components} and \l {Positioning Items}.
|
||||
\l {Creating Components} and \l {Positioning Components}.
|
||||
|
||||
\section1 Animating Progress Bar Elements
|
||||
|
||||
|
BIN
doc/qtdesignstudio/images/studio-3d-models.png
Normal file
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 11 KiB |
BIN
doc/qtdesignstudio/images/studio-qtquick-camera-properties.png
Normal file
After Width: | Height: | Size: 11 KiB |
@@ -252,7 +252,7 @@
|
||||
\section1 Importing Metadata & Assets
|
||||
|
||||
\QBPS can import metadata generated from other tools and generate a Photoshop document. A
|
||||
conventional workflow would be to generate metadata and assets by \l {Exporting QML} {exporting}
|
||||
conventional workflow would be to generate metadata and assets by \l {Exporting Components} {exporting}
|
||||
a QML project from \QDS and use \QBPS to generate a Photoshop document.
|
||||
|
||||
Imported text and the assets are organized into Artboards, layers, and groups.
|
||||
|
@@ -36,16 +36,16 @@
|
||||
You will need the following files:
|
||||
|
||||
\list
|
||||
\li Qt Quick file that will specify the API of the UI
|
||||
\li Component file (.qml) that will specify the API of the UI
|
||||
\li JavaScript file that generates mock data for the UI.
|
||||
For more information about using JavaScript, see
|
||||
\l{Integrating QML and JavaScript}.
|
||||
\li Module definition file (\e qmldir) that declares the QML type
|
||||
you specify in the Qt Quick file. For more information, see
|
||||
\li Module definition file (\e qmldir) that declares the component
|
||||
(QML type) you specify in the UI file. For more information, see
|
||||
\l {Module Definition qmldir Files}.
|
||||
\endlist
|
||||
|
||||
Here, you will create a QML type based on the QObject class that will
|
||||
Here, you will create a component based on the QObject class that will
|
||||
be registered as a singleton type. This enables the use of global
|
||||
property values 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.
|
||||
@@ -67,9 +67,9 @@
|
||||
to Qt Quick Application projects that contain .pro, .cpp, and .qrc
|
||||
files.
|
||||
|
||||
\li \l {Exporting QML}
|
||||
\li \l {Exporting Components}
|
||||
|
||||
You can export UI forms (ui.qml files) to JSON metadata format
|
||||
You can export UI files (.ui.qml) to JSON metadata format
|
||||
and PNG assets to generate native file formats in content creation
|
||||
tools, such as Adobe Photoshop, using \QB.
|
||||
|
||||
|
@@ -103,27 +103,27 @@
|
||||
\QDS creates the following files and folders:
|
||||
|
||||
\list
|
||||
\li .qmlproject project file defines that all QML, JavaScript, and image
|
||||
files in the project folder belong to the project. Therefore, you do
|
||||
not need to individually list all the files in the project.
|
||||
\li .qml file defines a UI item, such as a component, screen, or the
|
||||
whole UI.
|
||||
\li ui.qml file defines a form for the UI.
|
||||
\li .qmlproject project file defines that all component, JavaScript, and
|
||||
image files in the project folder belong to the project. Therefore,
|
||||
you do not need to individually list all the files in the project.
|
||||
\li .qml file defines the functionality and appearance of a component.
|
||||
\li ui.qml file defines a visual component that you can edit in
|
||||
\l{Form Editor}.
|
||||
\li qtquickcontrols2.conf file specifies the preferred style and some
|
||||
style-specific arguments.
|
||||
\li \e fonts folder contains font files that you have added in
|
||||
\l Library > \uicontrol Assets.
|
||||
\li \e imports folder contains a \e {Constants.qml} file that specifies
|
||||
a font loader for the Arial font and the screen resolution. The
|
||||
size of the default Screen.ui.qml Rectangle should be set as
|
||||
\c {width: Constants.width & height: Constants.height}, so it
|
||||
inherits the global resolution saved here.
|
||||
\li \e qmldir module definition file declares the Constant QML type.
|
||||
a font loader for the Arial font and the screen resolution. The size
|
||||
of the default Screen.ui.qml \l{basic-rectangle}{Rectangle} should
|
||||
be set as \c {width: Constants.width & height: Constants.height} so
|
||||
that it inherits the global resolution saved here.
|
||||
\li \e qmldir module definition file declares the Constant component.
|
||||
For more information, see \l {Module Definition qmldir Files}.
|
||||
\li In addition, the \e QtQuick subfolder contains the Studio components
|
||||
and effects QML types.
|
||||
\endlist
|
||||
|
||||
To use JavaScript and image files in the UI, select \uicontrol Library >
|
||||
Assets > Add New Assets.
|
||||
\uicontrol Assets > \inlineimage plus.png.
|
||||
|
||||
\section1 Adding Files to Projects
|
||||
|
||||
@@ -133,15 +133,16 @@
|
||||
\list
|
||||
\li \uicontrol {Qt Quick Files}
|
||||
\list
|
||||
\li \uicontrol {Flow Item} and \uicontrol {Flow View} generate
|
||||
types that you can use to design the application flow.
|
||||
\li \uicontrol {Qt Quick File} generates a QML type with one
|
||||
of the following basic types or \l{Using Positioners}
|
||||
{positioners} as the root item: \l {basic-item}{Item},
|
||||
\li \uicontrol {Flow Item} and \uicontrol {Flow View}
|
||||
generate components that you can use to design the
|
||||
\l{Designing Application Flows}{application flow}.
|
||||
\li \uicontrol {Qt Quick File} generates a component with one
|
||||
of the following default components or \l{Using Positioners}
|
||||
{positioners} as the root component: \l {basic-item}{Item},
|
||||
\l {basic-rectangle}{Rectangle}, \l {Images}{Image},
|
||||
\l {Border Image}, \l Flickable, Row, Column, Flow, or Grid.
|
||||
\li \uicontrol {Qt Quick UI File} generates a UI form with one
|
||||
of the above types as the root item.
|
||||
\li \uicontrol {Qt Quick UI File} generates a component file
|
||||
with one of the above components as the root component.
|
||||
\li \uicontrol {Qt Quick Views} generates a Grid View or a
|
||||
List View. For more information, see \l{List and Grid Views}.
|
||||
|
||||
|
@@ -88,7 +88,7 @@
|
||||
\li \l{Importing 3D Assets}
|
||||
\endlist
|
||||
\li \l{Converting UI Projects to Applications}
|
||||
\li \l{Exporting QML}
|
||||
\li \l{Exporting Components}
|
||||
\endlist
|
||||
\li \l{Creating UIs}
|
||||
\list
|
||||
@@ -107,10 +107,10 @@
|
||||
\li \l{Creating Scalable Buttons and Borders}
|
||||
\endlist
|
||||
\li \l{Specifying Component Properties}
|
||||
\li \l{Positioning Items}
|
||||
\li \l{Positioning Components}
|
||||
\li \l{Using Custom Fonts}
|
||||
\li \l{Annotating Designs}
|
||||
\li \l{Qt Quick UI Forms}
|
||||
\li \l{UI Files}
|
||||
\endlist
|
||||
\li \l {Adding Dynamics}
|
||||
\list
|
||||
@@ -128,12 +128,11 @@
|
||||
\endlist
|
||||
\li \l{Editing 3D Scenes}
|
||||
\list
|
||||
\li \l{Editing 3D Assets in Design Mode}
|
||||
\li \l{Adding 3D Views}
|
||||
\li \l{Using 3D Components}
|
||||
\list
|
||||
\li \l{Setting Group Properties}
|
||||
\li \l{Adding Models}
|
||||
\li \l{Adding 3D Models}
|
||||
\li \l{Using Materials and Shaders}
|
||||
\li \l{Attaching Textures to Materials}
|
||||
\li \l{Using 3D Materials}
|
||||
|
@@ -59,14 +59,14 @@
|
||||
\li \l{Using Git}
|
||||
\li \l{Importing Designs}
|
||||
\li \l{Converting UI Projects to Applications}
|
||||
\li \l{Exporting QML}
|
||||
\li \l{Exporting Components}
|
||||
\endlist
|
||||
\li \b {\l{Creating UIs}}
|
||||
\list
|
||||
\li \l{Designing Application Flows}
|
||||
\li \l{Creating Components}
|
||||
\li \l{Specifying Component Properties}
|
||||
\li \l{Positioning Items}
|
||||
\li \l{Positioning Components}
|
||||
\li \l{Annotating Designs}
|
||||
\endlist
|
||||
\li \b {\l{Adding Dynamics}}
|
||||
@@ -83,7 +83,6 @@
|
||||
\row
|
||||
\li \b {\l{Editing 3D Scenes}}
|
||||
\list
|
||||
\li \l{Editing 3D Assets in Design Mode}
|
||||
\li \l{3D Editor}
|
||||
\li \l{Adding 3D Views}
|
||||
\li \l{Using 3D Components}
|
||||
|
@@ -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 Qt Design Studio.
|
||||
@@ -35,9 +35,20 @@
|
||||
A camera is always necessary to view the content of a 3D scene. A camera
|
||||
defines how to project the content of a 3D scene into a 2D coordinate space,
|
||||
which can then be used on a 2D surface. When a camera is present in the
|
||||
scene, it can be used to direct what is displayed in a 3D view.
|
||||
scene, it can be used to direct what is displayed in a \l {Adding 3D Views}
|
||||
{3D view}.
|
||||
|
||||
You can use the following 3D QML types to determine camera projection:
|
||||
\image studio-qtquick-3d-components.png "Qt Quick 3D components in Library"
|
||||
|
||||
You can add a camera to your scene by dragging-and-dropping one from
|
||||
\l Library > \uicontrol Components > \uicontrol QtQuick3D > \uicontrol
|
||||
{Qt Quick 3D} to \l {3D Editor} or to a 3D view in \l Navigator.
|
||||
If the cameras are not displayed in \uicontrol Library, you should add the
|
||||
\uicontrol QtQuick3D module to your project, as described in
|
||||
\l {Adding and Removing Modules}.
|
||||
|
||||
You can use the following components in your scenes to determine camera
|
||||
projection:
|
||||
|
||||
\list
|
||||
\li \l{PerspectiveCamera}{Camera Perspective} - is the standard camera
|
||||
@@ -60,7 +71,7 @@
|
||||
You can position the camera in the scene and set the direction it is facing.
|
||||
The default direction of the camera is such that the forward vector is
|
||||
looking up the +z axis, and the up direction vector is up the +y axis. You
|
||||
can apply transforms to the camera and its parent types to define
|
||||
can apply transforms to the camera and its parent components to define
|
||||
exactly where your camera is located and in which direction it is facing.
|
||||
|
||||
The second part of determining the projection of the camera is defining the
|
||||
@@ -69,6 +80,8 @@
|
||||
|
||||
You can edit the camera properties in the \uicontrol Properties view.
|
||||
|
||||
\image studio-qtquick-camera-properties "Properties view for Perspective Camera"
|
||||
|
||||
\section1 Setting Camera Field of View
|
||||
|
||||
The camera frustum can be obtained by taking a frustum (that is, a
|
||||
|
@@ -30,24 +30,25 @@
|
||||
|
||||
\title Using 3D Components
|
||||
|
||||
To add 3D components to the scene, drag and drop a them from
|
||||
\uicontrol Library > \uicontrol {QML Types} > \uicontrol {Qt Quick 3D} to
|
||||
the scene or to a 3D view in \uicontrol Navigator.
|
||||
To use 3D components, you need to first add the required modules to your
|
||||
project in \l Library. For more information, see
|
||||
\l{Adding and Removing Modules}. You can then add 3D components to your scene
|
||||
by dragging-and-dropping them from \uicontrol Library > \uicontrol Components >
|
||||
\uicontrol QtQuick3D group to \l {3D Editor} or to a 3D view in \l Navigator.
|
||||
|
||||
\note Using 3D components will affect the performance of your UI. You should
|
||||
not use 3D components if the same results can be achieved using 2D
|
||||
components.
|
||||
|
||||
To edit 3D components, select the component in \uicontrol {3D Editor} or in
|
||||
\uicontrol Navigator and set its properties in the \uicontrol Properties
|
||||
view.
|
||||
\uicontrol Navigator and set its properties in the \l Properties view.
|
||||
|
||||
\list
|
||||
\li \l {Setting Group Properties}
|
||||
|
||||
You can set the opacity, visibility, and transform properties
|
||||
of all 3D components.
|
||||
\li \l {Adding Models}
|
||||
\li \l {Adding 3D Models}
|
||||
|
||||
You can use the model component to load static mesh data from
|
||||
storage or one of the built-in primitive types: cube, cone,
|
||||
@@ -55,7 +56,7 @@
|
||||
meshes and sub-meshes.
|
||||
\li \l {Using Materials and Shaders}
|
||||
|
||||
You can use materials and shaders to define how object surfaces
|
||||
You can use materials and shaders to define how component surfaces
|
||||
are rendered in a scene and during live preview.
|
||||
\li \l {Attaching Textures to Materials}
|
||||
|
||||
@@ -65,7 +66,6 @@
|
||||
\li \l {Using 3D Materials}
|
||||
|
||||
You can apply a set of predefined 3D materials on your models.
|
||||
|
||||
\li \l {Applying 3D Effects}
|
||||
|
||||
You can use 3D effect components to generate post-processing
|
||||
@@ -85,12 +85,12 @@
|
||||
scene and set their properties.
|
||||
\li \l {Using Scene Camera}
|
||||
|
||||
To project a 3D scene to a 2D viewport, such as
|
||||
\uicontrol {Form Editor}, it is necessary to view the scene from a
|
||||
camera. You can select the camera type and set its properties.
|
||||
To project a 3D scene to a 2D viewport, such as \l {Form Editor},
|
||||
it is necessary to view the scene from a camera. You can select the
|
||||
camera type and set its properties.
|
||||
\li \l {Setting Scene Environment}
|
||||
|
||||
You can use the SceneEnvironment type to specify how the scene is
|
||||
rendered globally.
|
||||
You can use the SceneEnvironment component to specify how the scene
|
||||
is rendered globally.
|
||||
\endlist
|
||||
*/
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Design Studio.
|
||||
@@ -39,23 +39,20 @@
|
||||
materials. Each effect or material must have a fragment shader that
|
||||
implements all the functions needed to calculate the shaded color. The
|
||||
material system also offers ready-made functions to help you implement
|
||||
the material.
|
||||
the material. If the 3D effects and materials are not displayed in
|
||||
\l Library, you should add the \uicontrol QtQuick3D.Effects and
|
||||
\uicontrol QtQuick3D.Materials modules to your project, as described in
|
||||
\l {Adding and Removing Modules}.
|
||||
|
||||
The material system supports dielectric, metallic, and transparent
|
||||
materials, point lights, area lights, ambient occlusion, shadowing,
|
||||
two-sided polygons, index-of-refraction, and fragment cutoff (masking).
|
||||
For more information, see \l {Qt Quick 3D Custom Material Reference}.
|
||||
|
||||
You can use the QML types in the \uicontrol {Qt Quick 3D Custom Shader Utils}
|
||||
tab of \uicontrol Library to create custom effects and materials. To make
|
||||
the \uicontrol Effect and \uicontrol {Custom Material} types appear in the
|
||||
tab, you must select \uicontrol {Add Import} in the \uicontrol {QML Imports}
|
||||
tab, and then select \uicontrol QtQuick3D.Effects and
|
||||
\uicontrol QtQuick3D.Materials to import the QML types in those modules to
|
||||
your project.
|
||||
|
||||
For more information about the shader utilities and commands and their
|
||||
properties, see \l {Using Custom Shaders}.
|
||||
You can use the components in \uicontrol Library > \uicontrol Components >
|
||||
\uicontrol QtQuick3D > \uicontrol {Qt Quick 3D Custom Shader Utils} to
|
||||
create custom effects and materials. For more information about the shader
|
||||
utilities and commands and their properties, see \l {Using Custom Shaders}.
|
||||
|
||||
\image studio-qtquick-3d-shader-utilities.png "Qt Quick 3D Custom Shader Utils tab in Library"
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Design Studio.
|
||||
@@ -32,8 +32,15 @@
|
||||
|
||||
\title Using Custom Shaders
|
||||
|
||||
You can use the Qt Quick 3D shader utilities and commands to create your own
|
||||
effects and materials.
|
||||
You can use the 3D shader utilities and commands available in \l Library
|
||||
> \uicontrol Components > \uicontrol QtQuick3D > \uicontrol
|
||||
{Custom Shader Utils} to create your own effects and materials.
|
||||
|
||||
\image studio-qtquick-3d-shader-utilities.png
|
||||
|
||||
If the custom shader utilities are not displayed in \uicontrol Library, you
|
||||
should add the \uicontrol QtQuick3D module to your project, as described in
|
||||
\l {Adding and Removing Modules}.
|
||||
|
||||
For more information on using the shaders, see
|
||||
\l {Creating Custom Effects and Materials}.
|
||||
|
@@ -1,85 +0,0 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Design Studio 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 studio-3d-design-mode.html
|
||||
\if defined (qtdesignstudio)
|
||||
\previouspage studio-3d.html
|
||||
\else
|
||||
\previouspage studio-importing-3d.html
|
||||
\endif
|
||||
\nextpage studio-3d-editor.html
|
||||
|
||||
\title Editing 3D Assets in Design Mode
|
||||
|
||||
\QDS opens QML files that contain 3D scenes in the Design mode and the
|
||||
scenes in \uicontrol {3D Editor}. You can add imported 3D assets to projects
|
||||
and edit them to create scenes and states, as well as the transitions
|
||||
between them. The other views enable you to select QML types to use in the
|
||||
scene, specify properties for them, and view them in a tree structure,
|
||||
as well as to create connections and browse projects and files.
|
||||
|
||||
\image studio-editing-3d-scenes.png "Views for editing 3D assets in Design mode"
|
||||
|
||||
To open the following views, select \uicontrol View > \uicontrol Views:
|
||||
|
||||
\list
|
||||
\li \uicontrol {3D Editor} (1) is the working area where you create the
|
||||
scene, position the model, light and camera, as well as move, rotate
|
||||
and scale items. For more information on how to edit 3D scenes, see
|
||||
\l {3D Editor}.
|
||||
\li \uicontrol {Form Editor} (2) is where you see the scene projected by
|
||||
the camera.
|
||||
\li \uicontrol {Library} (3) displays the building blocks that you
|
||||
can use to create scenes: predefined Qt Quick 3D Components,
|
||||
Qt Quick Controls, your own 3D assets that you import to the
|
||||
project, and other assets. For more information, see \l {Adding 3D
|
||||
Views}.
|
||||
\li \uicontrol {Navigator} (4) displays the items in the current QML
|
||||
file as a tree structure. For more information, see
|
||||
\l {Navigator}.
|
||||
\li \uicontrol {Properties} (5) organizes the properties of the
|
||||
selected item. You can change the properties also in \uicontrol
|
||||
{Text Editor}. For more information, see
|
||||
\l {Specifying Component Properties}.
|
||||
\li \uicontrol Connections (6) enables you to create connections
|
||||
between objects, signals, and object properties. For more
|
||||
information, see \l{Adding Connections}.
|
||||
\li \uicontrol States displays the different states of the item. QML
|
||||
states typically describe user interface configurations, such as the
|
||||
UI controls, their properties and behavior and the available
|
||||
actions. For more information, see \l {Adding States}.
|
||||
\li \uicontrol Timeline provides a timeline and keyframe based
|
||||
editor that enables you to animate the properties of components.
|
||||
For more information, see \l {Creating Animations}.
|
||||
\endlist
|
||||
|
||||
For more information, watch the following video:
|
||||
|
||||
\youtube w1yhDl93YI0
|
||||
|
||||
For more information on other views, see
|
||||
\l {Design Views}.
|
||||
*/
|
@@ -41,11 +41,11 @@
|
||||
|
||||
When you import 3D scenes from files that you exported from 3D graphics
|
||||
tools, you also import a \l{Using Scene Camera}{scene camera},
|
||||
\l{Using Lights}{light}, \l{Adding Models}{model}, and
|
||||
\l{Using Lights}{light}, \l{Adding 3D Models}{model}, and
|
||||
\l {Using Materials and Shaders}{materials}. If your scene did not contain
|
||||
them, you can add the corresponding \l {Using 3D Components}{Qt Quick 3D}
|
||||
components from \l Library > \uicontrol Components > \uicontrol QtQuick3D >
|
||||
\uicontrol {Qt Quick 3D}.
|
||||
components from \l Library > \uicontrol Components > \inlineimage plus.png
|
||||
> \uicontrol QtQuick3D > \uicontrol {Qt Quick 3D}.
|
||||
|
||||
You can use the \l{Summary of the 3D Editor Toolbar Buttons}{toolbar buttons}
|
||||
to \e transform 3D components and manipulate the 3D scene. Transformation
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Design Studio.
|
||||
@@ -32,16 +32,15 @@
|
||||
|
||||
\title Applying 3D Effects
|
||||
|
||||
\QDS provides a set of Qt Quick 3D effects that inherit the types in the
|
||||
\l {Qt Quick 3D Effects QML Types}{Qt Quick 3D Effects} module.
|
||||
|
||||
To apply a visual effect to a scene, drag-and-drop an effect from
|
||||
the \uicontrol {Qt Quick 3D Effects} tab in \uicontrol Library to a
|
||||
\uicontrol {View 3D} object in \uicontrol Navigator. You can apply multiple
|
||||
\QDS provides a set of 3D effects, which are visible in \l {Form Editor}.
|
||||
To apply a visual effect to a scene, drag-and-drop an effect from \l Library
|
||||
> \uicontrol Components > \uicontrol QtQuick3D > \uicontrol {Qt Quick 3D Effects}
|
||||
to a \uicontrol View3D component in \l Navigator. You can apply multiple
|
||||
effects to a scene. Select the \uicontrol {Scene Environment} component in
|
||||
\uicontrol Navigator to view the applied effects in \uicontrol Properties >
|
||||
\uicontrol {Scene Environment} > \uicontrol Effect. The effects are visible
|
||||
in the \uicontrol {Form Editor} view.
|
||||
\uicontrol Navigator to view the applied effects in \l Properties >
|
||||
\uicontrol {Scene Environment} > \uicontrol Effect. If the effects are not
|
||||
displayed in \l Library, you should add the \uicontrol QtQuick3D.Effects
|
||||
module to your project, as described in \l {Adding and Removing Modules}.
|
||||
|
||||
See the following table for available effects and example images.
|
||||
|
||||
@@ -136,9 +135,9 @@
|
||||
camera where the content is in perfect focus.
|
||||
|
||||
The \uicontrol {Focus Range} property specifies the distance around the
|
||||
\uicontrol {Focus Distance} where items are fully in focus. The focus
|
||||
then fades away to fully blurred by the same distance on both the near
|
||||
and far sides.
|
||||
\uicontrol {Focus Distance} where components are fully in focus. The
|
||||
focus then fades away to fully blurred by the same distance on both the
|
||||
near and far sides.
|
||||
|
||||
\row
|
||||
\li Desaturate
|
||||
@@ -232,9 +231,9 @@
|
||||
\row
|
||||
\li Gaussian Blur
|
||||
\li \image effect-gaussian-blur.png "The Gaussian Blur effect"
|
||||
\li A two-pass gaussian blur effect that blurs all objects in the scene
|
||||
evenly. To keep the effect performant, large blur amount produces a
|
||||
mosaic result instead of smooth blurriness.
|
||||
\li A two-pass gaussian blur effect that blurs all components in the
|
||||
scene evenly. To keep the effect performant, large blur amount produces
|
||||
a mosaic result instead of smooth blurriness.
|
||||
|
||||
The \uicontrol Amount property defines the strength of the blur.
|
||||
|
||||
@@ -272,7 +271,7 @@
|
||||
\li Motion Blur
|
||||
\li \image effect-motion-blur.png "The Motion Blur effect"
|
||||
\li A motion blur effect that creates an apparent streaking for rapidly
|
||||
moving objects in the scene.
|
||||
moving components in the scene.
|
||||
|
||||
\note Only has a visible effect if the background of the scene is set to
|
||||
be transparent in the \uicontrol {Background Mode} field of the
|
||||
@@ -351,21 +350,21 @@
|
||||
focus bar in normalized coordinates.
|
||||
|
||||
The \uicontrol {Focus Width} property defines a normalized range for
|
||||
Focus Position. Objects within this range will be in focus.
|
||||
Focus Position. Components within this range will be in focus.
|
||||
|
||||
The \uicontrol {Blur Amount} property defines the amount of blur.
|
||||
Amounts above 4 may cause artifacts.
|
||||
|
||||
The \uicontrol Vertical property changes the direction of the effect
|
||||
from horizontal to vertical, while the \uicontrol Inverted property
|
||||
inverts the blur area, causing the center of the object to become
|
||||
inverts the blur area, causing the center of the component to become
|
||||
blurred.
|
||||
|
||||
\row
|
||||
\li Vignette
|
||||
\li \image effect-vignette.png "The Vignette effect"
|
||||
\li A vignette effect that reduces brightness towards the periphery of
|
||||
an object.
|
||||
a component.
|
||||
|
||||
The \uicontrol Strength property defines the strength of vignetting,
|
||||
while \uicontrol Radius specifies its size.
|
||||
|
@@ -30,7 +30,7 @@
|
||||
\nextpage quick-converting-ui-projects.html
|
||||
\else
|
||||
\previouspage exporting-from-maya.html
|
||||
\nextpage studio-3d-design-mode.html
|
||||
\nextpage studio-3d-editor.html
|
||||
\endif
|
||||
|
||||
\title Importing 3D Assets
|
||||
|
@@ -34,10 +34,12 @@
|
||||
|
||||
Light components are the primary source of lighting in a \QDS scene.
|
||||
As a secondary light source, you can use \l{Using Image-based Lighting}
|
||||
{image-based lighting}.
|
||||
{image-based lighting}. If the light components are not displayed in
|
||||
\l Library, you should add the \uicontrol QtQuick3D module to your project,
|
||||
as described in \l {Adding and Removing Modules}.
|
||||
|
||||
By default, all imported scenes are created with one directional light.
|
||||
You can use the following \l{Qt Quick 3D} components to add lights:
|
||||
You can use the following components to add lights:
|
||||
|
||||
\list
|
||||
\li \l{DirectionalLight}{Light Directional}
|
||||
@@ -116,8 +118,8 @@
|
||||
Turn up the quadratic fade to increase the rate at which the lighting effect
|
||||
dims on surfaces that are far away from the light. The value 1.0 means that
|
||||
the point light fade exactly follows the inverse square law. For example,
|
||||
when the distance to an object doubles, the light intensity decreases to one
|
||||
fourth.
|
||||
when the distance to a component doubles, the light intensity decreases to
|
||||
one fourth.
|
||||
|
||||
Aside from fade, a point light has the same properties as a directional
|
||||
light.
|
||||
@@ -142,14 +144,14 @@
|
||||
|
||||
An area light is similar to the directional light. However, instead of
|
||||
emitting an equally bright light across the whole scene, the area light
|
||||
emits directional light from a rectangle shaped object. You can set the
|
||||
emits directional light from a rectangle shaped component. You can set the
|
||||
\uicontrol Width and \uicontrol Height properties to determine the size
|
||||
of the area light.
|
||||
|
||||
Aside from the size, an area light has the same properties as a directional
|
||||
light.
|
||||
|
||||
The image below shows an example on how to light an object with different
|
||||
The image below shows an example on how to light a component with different
|
||||
colors using two different area lights.
|
||||
|
||||
\image studio-3d-area-light.png
|
||||
@@ -168,7 +170,7 @@
|
||||
\uicontrol {Shadow filter} property.
|
||||
|
||||
Tweak the \uicontrol {Shadow bias} property value by small amounts
|
||||
if you see objects casting shadows on themselves.
|
||||
if you see components casting shadows on themselves.
|
||||
|
||||
To specify the quality of the shadow map created for shadow rendering, set
|
||||
the \uicontrol {Shadow map quality} property. Lower quality uses less
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Design Studio.
|
||||
@@ -220,11 +220,11 @@
|
||||
|
||||
\section1 Applying Materials to Models
|
||||
|
||||
To apply materials to models:
|
||||
To apply materials to \l {Adding 3D Models}{models}:
|
||||
|
||||
\list 1
|
||||
\li Drag and drop a material component from the \uicontrol Library to a
|
||||
Model component in the \uicontrol Navigator.
|
||||
\li Drag and drop a material component from \l Library to a model
|
||||
component in \l Navigator.
|
||||
\li Select the Model component.
|
||||
\li In the \uicontrol Properties view, select the material for the model
|
||||
in the \uicontrol Materials list.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Design Studio.
|
||||
@@ -33,12 +33,15 @@
|
||||
\title Using 3D Materials
|
||||
|
||||
\QDS provides a set of pregenerated Qt Quick 3D materials that can be used
|
||||
to create good-looking models quickly and easily.
|
||||
to create good-looking \l {Adding 3D Models}{models} quickly and easily.
|
||||
|
||||
To apply a 3D material to a component, drag-and-drop a material from the
|
||||
\uicontrol {Qt Quick 3D Materials} tab of \uicontrol Library to a model
|
||||
component in \uicontrol Navigator. The materials you add to the model are
|
||||
listed in the model component's \uicontrol Properties view.
|
||||
To apply a 3D material to a component, drag-and-drop a material from
|
||||
\l Library > \uicontrol Components > \uicontrol QtQuick3D >
|
||||
\uicontrol {Qt Quick 3D Materials} to a model component in \l Navigator.
|
||||
The materials you add to the model are listed in the model component's
|
||||
\l Properties view. If the 3D materials are not displayed in \l Library,
|
||||
you should add the \uicontrol QtQuick3D.Materials module to your project, as
|
||||
described in \l {Adding and Removing Modules}.
|
||||
|
||||
Each material has its own set of properties that can be used to further
|
||||
define the appearance of the material. For each material the \uicontrol
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Design Studio.
|
||||
@@ -30,16 +30,24 @@
|
||||
\previouspage studio-3d-node.html
|
||||
\nextpage studio-3d-materials.html
|
||||
|
||||
\title Adding Models
|
||||
\title Adding 3D Models
|
||||
|
||||
\QDS \l Library features some built-in primitive 3D models. This allows you
|
||||
to add cubes, cones, cylinders, and planes (rectangles) to your scene.
|
||||
|
||||
\image studio-3d-models.png
|
||||
|
||||
A Model component loads mesh data from a file. You can modify how the
|
||||
component is shaded by adding materials to the model.
|
||||
component is shaded by adding \l{Using 3D Materials}{materials} to the model.
|
||||
|
||||
A model can load static meshes from storage or one of the built-in primitive
|
||||
types: cube, cone, cylinder, plane (rectangle) or sphere. You can drag and
|
||||
drop a model from the \uicontrol Library to a 3D scene.
|
||||
You can drag-and-drop a model from \uicontrol Library > \uicontrol Components
|
||||
> \uicontrol QtQuick3D > \uicontrol {Qt Quick 3D} to \l {3D Editor} or to
|
||||
\l Navigator > \uicontrol {Scene Environment} > \uicontrol Scene. If the
|
||||
models are not displayed in \uicontrol Library, you should add the
|
||||
\uicontrol QtQuick3D module to your project, as described in
|
||||
\l {Adding and Removing Modules}.
|
||||
|
||||
\image studio-qtquick-3d-components.png "Library view QML Types tab Qt Quick 3D section"
|
||||
\image studio-qtquick-3d-components.png "The Qt Quick 3D section in Library"
|
||||
|
||||
You can change the model type in the \uicontrol Source field in the
|
||||
\uicontrol Properties view. Select the \inlineimage plus.png
|
||||
|
@@ -30,13 +30,19 @@
|
||||
|
||||
\title Setting Group Properties
|
||||
|
||||
The \uicontrol Group component is a \uicontrol Node type that can be used to
|
||||
wrap other objects for the purpose of grouping them. This allows you to
|
||||
transform and set the opacity and visibility of multiple 3D components in
|
||||
the \uicontrol Properties view simultaneously. To add a \uicontrol Group
|
||||
component to your scene, drag-and-drop it from \uicontrol Library >
|
||||
\uicontrol {QML Types} > \uicontrol {Qt Quick 3D} to the \uicontrol
|
||||
{3D Editor} view or to a \uicontrol Scene component in \uicontrol Navigator.
|
||||
The \uicontrol Group component is a \uicontrol Node component that can be
|
||||
used to wrap other objects for the purpose of grouping them. This allows you
|
||||
to transform and set the opacity and visibility of multiple 3D components in
|
||||
the \l Properties view simultaneously. To add a \uicontrol Group component
|
||||
to your scene, drag-and-drop it from \l Library > \uicontrol Components >
|
||||
\uicontrol {QtQuick3D} > \uicontrol {Qt Quick 3D} to the \l {3D Editor} view
|
||||
or to a \uicontrol Scene component in \l Navigator. If the \uicontrol Group
|
||||
component is not displayed in\uicontrol Library, you should add the
|
||||
\uicontrol QtQuick3D module to your project, as described in
|
||||
\l {Adding and Removing Modules}.
|
||||
|
||||
Select the \uicontrol Group component in \uicontrol Navigator to modify its
|
||||
properties in the \l Properties view.
|
||||
|
||||
\section1 Setting Node Opacity and Visibility
|
||||
|
||||
@@ -84,6 +90,6 @@
|
||||
around a point other than its local origin. Pivot values are applied before
|
||||
scaling and rotation values.
|
||||
|
||||
A line is drawn in the 3D editor from the pivot point to the center of the
|
||||
component to provide a visual connection between them.
|
||||
A line is drawn in \uicontrol {3D Editor} from the pivot point to the center
|
||||
of the component to provide a visual connection between them.
|
||||
*/
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Copyright (C) 2021 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of Qt Design Studio.
|
||||
@@ -32,8 +32,9 @@
|
||||
|
||||
\title Attaching Textures to Materials
|
||||
|
||||
You can use the Texture 3D QML type to attach textures to materials.
|
||||
You specify an image and how it is mapped to meshes in a 3D scene.
|
||||
You can use the \uicontrol Texture component to attach textures to materials.
|
||||
You specify an image to use as the source file for the \uicontrol Texture,
|
||||
and also define how it is mapped to meshes in a 3D scene.
|
||||
|
||||
\image studio-qtquick-3d-texture.png "Texture attached to a material in Design mode"
|
||||
|
||||
@@ -45,7 +46,7 @@
|
||||
|
||||
UV mapping is the process of projecting 2D images to the surface of a
|
||||
3D model for texture mapping. The letters \e U and \e V denote the axes
|
||||
of the 2D texture, because x, y, and z are already used to denote the
|
||||
of the 2D texture because x, y, and z are already used to denote the
|
||||
axes of the 3D object in the model space. You can paint the polygons that
|
||||
make up a 3D object with color and other surface attributes from a UV
|
||||
texture map. Pixels in the image are assigned to surface mappings on the
|
||||
@@ -112,24 +113,29 @@
|
||||
|
||||
\section1 Applying Textures to Materials
|
||||
|
||||
Drag and drop an image from \uicontrol Library > \uicontrol Assets
|
||||
on a material to create a texture component. Dragging an image
|
||||
to a default or principled material opens a
|
||||
\uicontrol {Select Texture Property} dialog. You can select the
|
||||
property to attach the texture to in the \uicontrol {Set texture to property}
|
||||
field. For a custom material, you must assign the texture to a map.
|
||||
Drag-and-drop an image from \l Library > \uicontrol Assets on a material to
|
||||
create a texture component. Dragging an image to a default or principled
|
||||
material opens a \uicontrol {Select Texture Property} dialog. You can select
|
||||
the property to attach the texture to in the \uicontrol {Set texture to property}
|
||||
field. For a custom material, you must assign the texture to a map. If the
|
||||
\uicontrol Texture component is not displayed in \uicontrol Library, you
|
||||
should add the \uicontrol QtQuick3D module to your project, as described in
|
||||
\l {Adding and Removing Modules}.
|
||||
|
||||
To use Texture components to apply textures to materials:
|
||||
To use Texture components to apply textures to materials, drag-and-drop a
|
||||
Texture component from \l Library to a material component in \l Navigator.
|
||||
The new texture should now be visible in \l {Form Editor} and \l {3D Editor}.
|
||||
\note If the colors in your texture are not visualized correctly, you should
|
||||
check the color in the \uicontrol Diffuse property of the material and try
|
||||
changing it to white (#ffffff).
|
||||
|
||||
\list 1
|
||||
\li Drag and drop a Texture component from the \uicontrol Library to a
|
||||
material component in the \uicontrol Navigator.
|
||||
\li In the \uicontrol Properties view, specify the image to use in the
|
||||
\uicontrol Source field.
|
||||
\image studio-qtquick-3d-texture-properties.png "Texture properties"
|
||||
\li Select the material component and specify the id of the texture to
|
||||
use in the \uicontrol Properties view, \uicontrol {Diffuse map}
|
||||
field.
|
||||
\image studio-qtquick-3d-material-texture.png "Material properties"
|
||||
|
||||
To change the source file for the texture, select the \uicontrol Texture
|
||||
component in \uicontrol Navigator, go to the \uicontrol Properties view, and
|
||||
specify a new image to use in the \uicontrol Source field.
|
||||
|
||||
\image studio-qtquick-3d-texture-properties.png "Texture properties"
|
||||
|
||||
\endlist
|
||||
*/
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 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,24 +31,23 @@
|
||||
\title Adding 3D Views
|
||||
|
||||
To create a Qt Quick 3D UI project, we recommend using a \uicontrol
|
||||
{Qt Quick 3D Application Template} wizard template that imports the
|
||||
\l{Qt Quick 3D} QML types to the \uicontrol {QML Types} tab in
|
||||
\uicontrol Library and contains a 3D view. A 3D view type includes a
|
||||
\l {Setting Scene Environment}{scene environment} as well as a scene
|
||||
\l {Using Lights}{light}, \l {Using Scene Camera}{camera}, and \l {Adding
|
||||
Models}{model}. A default \l {Using Materials and Shaders}{material} is
|
||||
attached to the model. You can attach \l {Attaching Textures to Materials}
|
||||
{textures} to materials. For more information about creating projects, see
|
||||
\l{Creating Projects}.
|
||||
{Qt Quick 3D Application Template} wizard template that adds the
|
||||
\l {Using 3D Components}{Qt Quick 3D} components to \l Library and contains
|
||||
a 3D view. A 3D view component includes a \l {Setting Scene Environment}
|
||||
{scene environment} as well as a scene \l {Using Lights}{light},
|
||||
\l {Using Scene Camera}{camera}, and \l {Adding 3D Models}{model}. A default
|
||||
\l {Using Materials and Shaders}{material} is attached to the model. You can
|
||||
attach \l {Attaching Textures to Materials}{textures} to materials. For more
|
||||
information about creating projects, see \l{Creating Projects}.
|
||||
|
||||
To add a 3D view to some other kind of project and to display the Qt Quick
|
||||
3D QML types in \uicontrol Library, select \uicontrol Library >
|
||||
\uicontrol {QML Imports} > \uicontrol {Add Import} > \uicontrol QtQuick3D.
|
||||
To add a 3D view to some other kind of a project, you should first add the
|
||||
\uicontrol QtQuick3D module to \uicontrol Library, as described in
|
||||
\l {Adding and Removing Modules}.
|
||||
|
||||
\image studio-qtquick-3d-components.png "Qt Quick 3D components in Library"
|
||||
|
||||
After importing the Qt Quick 3D QML types, drag and drop a \uicontrol
|
||||
View3D type to \uicontrol Navigator or to \uicontrol {Form Editor}.
|
||||
You can now drag-and-drop a \uicontrol View3D component to \l Navigator or
|
||||
to \l {Form Editor}.
|
||||
|
||||
\image studio-navigator-view3d.png "A View 3D component in the Navigator"
|
||||
|
||||
@@ -64,7 +63,7 @@
|
||||
Similarly to other components, you can select a 3D view in \uicontrol
|
||||
Navigator or \uicontrol {3D Editor} and modify its property values in the
|
||||
\uicontrol Properties view. Use the properties in the \uicontrol View3D
|
||||
tab to set some properties specific to a 3D view component.
|
||||
tab to set properties specific to a 3D view component.
|
||||
|
||||
\image studio-qtquick-3d-view.png "View 3D component properties"
|
||||
|
||||
@@ -78,7 +77,7 @@
|
||||
|
||||
The \uicontrol {Import Scene} property defines the ID of the component to
|
||||
render to \uicontrol {Form Editor}. The component does not have to be a
|
||||
child of a 3D view type. This referenced component becomes a sibling to
|
||||
child of a 3D view component. This referenced component becomes a sibling to
|
||||
child items of a 3D view, if there are any. You can use this property, for
|
||||
example, to create a split screen view showing your scene from multiple
|
||||
cameras. For more information on how to to use a 3D view to show a scene
|
||||
@@ -86,5 +85,4 @@
|
||||
|
||||
\note The \uicontrol {Import Scene} property can only be set once.
|
||||
Subsequent changes will have no effect.
|
||||
|
||||
*/
|
||||
|
@@ -27,7 +27,7 @@
|
||||
\page studio-3d.html
|
||||
\previouspage quick-states.html
|
||||
\if defined(qtdesignstudio)
|
||||
\nextpage studio-3d-design-mode.html
|
||||
\nextpage studio-3d-view.html
|
||||
\else
|
||||
\nextpage exporting-3d-assets.html
|
||||
\endif
|
||||
@@ -44,9 +44,9 @@
|
||||
When you import 3D scenes from files that you exported from 3D graphics
|
||||
tools, you also import the camera, light, model, and materials as 3D
|
||||
components. If your scene did not contain them, you can add predefined
|
||||
Qt Quick 3D components to it and edit their properties to fit your needs.
|
||||
3D components to it and edit their properties to fit your needs.
|
||||
|
||||
The following topics contain information about working with Qt Quick 3D:
|
||||
The following topics contain information about editing 3D scenes:
|
||||
|
||||
\list
|
||||
\if defined (qtcreator)
|
||||
@@ -62,12 +62,6 @@
|
||||
applications and stored in one of the supported file formats.
|
||||
You can then edit them in the Design mode.
|
||||
\endif
|
||||
|
||||
\li \l {Editing 3D Assets in Design Mode}
|
||||
|
||||
\QDS opens QML files that contain 3D scenes in the Design mode and
|
||||
the scenes in \uicontrol {3D Editor}. You can add imported 3D assets
|
||||
to projects as 3D components.
|
||||
\li \l{Adding 3D Views}
|
||||
|
||||
You can drag and drop 3D components from \uicontrol Library
|
||||
@@ -78,4 +72,9 @@
|
||||
You can speficy properties for 3D components, such as cameras,
|
||||
lights, materials, and shaders, in the \uicontrol Properties view.
|
||||
\endlist
|
||||
|
||||
For more information, watch the following video:
|
||||
|
||||
\youtube w1yhDl93YI0
|
||||
|
||||
*/
|
||||
|
@@ -1430,7 +1430,7 @@ class DumperBase():
|
||||
intSize = 4
|
||||
ptrSize = self.ptrSize()
|
||||
if self.qtVersion() >= 0x060000:
|
||||
# Size of QObjectData: 7 pointer + 2 int
|
||||
# Size of QObjectData: 9 pointer + 2 int
|
||||
# - vtable
|
||||
# - QObject *q_ptr;
|
||||
# - QObject *parent;
|
||||
@@ -1438,7 +1438,8 @@ class DumperBase():
|
||||
# - uint isWidget : 1; etc...
|
||||
# - int postedEvents;
|
||||
# - QDynamicMetaObjectData *metaObject;
|
||||
extra = self.extractPointer(dd + 7 * ptrSize + 2 * intSize)
|
||||
# - QBindingStorage bindingStorage;
|
||||
extra = self.extractPointer(dd + 9 * ptrSize + 2 * intSize)
|
||||
if extra == 0:
|
||||
return False
|
||||
|
||||
@@ -1780,7 +1781,10 @@ class DumperBase():
|
||||
|
||||
def metaString(self, metaObjectPtr, index, revision):
|
||||
ptrSize = self.ptrSize()
|
||||
stringdata = self.extractPointer(toInteger(metaObjectPtr) + ptrSize)
|
||||
stringdataOffset = ptrSize
|
||||
if self.isWindowsTarget():
|
||||
stringdataOffset += ptrSize # indirect super data member
|
||||
stringdata = self.extractPointer(toInteger(metaObjectPtr) + stringdataOffset)
|
||||
|
||||
def unpackString(base, size):
|
||||
try:
|
||||
@@ -1891,7 +1895,13 @@ class DumperBase():
|
||||
extraData = 0
|
||||
if qobjectPtr:
|
||||
dd = self.extractPointer(qobjectPtr + ptrSize)
|
||||
if self.qtVersion() >= 0x50000:
|
||||
if self.qtVersion() >= 0x60000:
|
||||
(dvtablePtr, qptr, parent, children, bindingStorageData, bindingStatus,
|
||||
flags, postedEvents, dynMetaObjectPtr, # Up to here QObjectData.
|
||||
extraData, threadDataPtr, connectionListsPtr,
|
||||
sendersPtr, currentSenderPtr) \
|
||||
= self.split('pp{@QObject*}{@QList<@QObject *>}ppIIp' + 'ppppp', dd)
|
||||
elif self.qtVersion() >= 0x50000:
|
||||
(dvtablePtr, qptr, parent, children, flags, postedEvents,
|
||||
dynMetaObjectPtr, # Up to here QObjectData.
|
||||
extraData, threadDataPtr, connectionListsPtr,
|
||||
|
@@ -2101,7 +2101,9 @@ def qdumpHelper__QVariant6(d, value):
|
||||
_, data = d.split('8s{%s}' % typeName, ptr)
|
||||
d.putItem(data)
|
||||
else:
|
||||
d.putItem(d.createValue(data, typeName))
|
||||
val = d.createValue(data, typeName)
|
||||
val.laddress = value.laddress
|
||||
d.putItem(val)
|
||||
|
||||
d.putBetterType('@QVariant (%s)' % typeName)
|
||||
|
||||
@@ -2826,14 +2828,14 @@ def qdump_64__QJSValue_6(d, value):
|
||||
elif typ > 7:
|
||||
val = d.Value(d)
|
||||
val.ldata = struct.pack('q', dd ^ 0xfffc000000000000)
|
||||
val.type = d.createType('double')
|
||||
val._type = d.createType('double')
|
||||
d.putItem(val)
|
||||
d.putType(value.type.name + ' (double)')
|
||||
elif typ <= 3: # Heap
|
||||
if dd & 1: # String
|
||||
val = d.Value(d)
|
||||
val.ldata = struct.pack('q', dd & ~1)
|
||||
val.type = d.createType('@QString*')
|
||||
val._type = d.createType('@QString*')
|
||||
d.putItem(val)
|
||||
d.putType(value.type.name + ' (QString)')
|
||||
else:
|
||||
|
@@ -78,7 +78,6 @@ ScrollView {
|
||||
|
||||
property string importToRemove: ""
|
||||
property string importToAdd: ""
|
||||
property var currentItem: null
|
||||
|
||||
// called from C++ to close context menu on focus out
|
||||
function closeContextMenu()
|
||||
@@ -136,9 +135,9 @@ ScrollView {
|
||||
|
||||
StudioControls.MenuItem {
|
||||
id: importMenuItem
|
||||
text: qsTr("Import Module: ") + importToAdd
|
||||
enabled: currentItem
|
||||
onTriggered: rootView.addImportForItem(currentItem)
|
||||
text: qsTr("Add Module: ") + importToAdd
|
||||
enabled: importToAdd !== ""
|
||||
onTriggered: rootView.addImportForItem(importToAdd)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -159,8 +158,6 @@ ScrollView {
|
||||
: StudioTheme.Values.themeTextColor
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
expanded: importExpanded
|
||||
expandOnClick: false
|
||||
onToggleExpand: {
|
||||
@@ -184,8 +181,8 @@ ScrollView {
|
||||
hideHeader: categoryModel.rowCount() <= 1
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
addTopPadding: categoryModel.rowCount() > 1
|
||||
addBottomPadding: index != categoryModel.rowCount() - 1
|
||||
caption: categoryName + " (" + itemModel.rowCount() + ")"
|
||||
visible: categoryVisible
|
||||
expanded: categoryExpanded
|
||||
@@ -213,8 +210,6 @@ ScrollView {
|
||||
onShowContextMenu: {
|
||||
if (!itemUsable) {
|
||||
importToAdd = itemRequiredImport
|
||||
if (importToAdd !== "") {
|
||||
currentItem = itemLibraryEntry
|
||||
itemContextMenu.popup()
|
||||
}
|
||||
}
|
||||
@@ -227,5 +222,4 @@ ScrollView {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -40,15 +40,15 @@ Item {
|
||||
property alias showArrow: arrow.visible
|
||||
|
||||
property int leftPadding: 8
|
||||
property int topPadding: 4
|
||||
property int rightPadding: 0
|
||||
property int bottomPadding: 4
|
||||
|
||||
property bool expanded: true
|
||||
property int level: 0
|
||||
property int levelShift: 10
|
||||
property bool hideHeader: false
|
||||
property bool expandOnClick: true // if false, toggleExpand signal will be emitted instead
|
||||
property bool addTopPadding: true
|
||||
property bool addBottomPadding: true
|
||||
|
||||
onHideHeaderChanged:
|
||||
{
|
||||
@@ -120,11 +120,12 @@ Item {
|
||||
|
||||
readonly property alias contentItem: row
|
||||
|
||||
implicitHeight: Math.round(row.height + header.height + topRow.height + bottomRow.height)
|
||||
implicitHeight: Math.round(row.height + header.height + topSpacer.height + bottomSpacer.height)
|
||||
|
||||
Row {
|
||||
id: topRow
|
||||
height: StudioTheme.Values.sectionHeadSpacerHeight
|
||||
|
||||
Item {
|
||||
id: topSpacer
|
||||
height: addTopPadding && row.height > 0 ? StudioTheme.Values.sectionHeadSpacerHeight : 0
|
||||
anchors.top: header.bottom
|
||||
}
|
||||
|
||||
@@ -134,12 +135,12 @@ Item {
|
||||
anchors.leftMargin: section.leftPadding
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: section.rightPadding
|
||||
anchors.top: topRow.bottom
|
||||
anchors.top: topSpacer.bottom
|
||||
}
|
||||
|
||||
Row {
|
||||
id: bottomRow
|
||||
height: StudioTheme.Values.sectionHeadSpacerHeight
|
||||
Item {
|
||||
id: bottomSpacer
|
||||
height: addBottomPadding && row.height > 0 ? StudioTheme.Values.sectionHeadSpacerHeight : 0
|
||||
anchors.top: row.bottom
|
||||
}
|
||||
|
||||
|
@@ -1,15 +1,16 @@
|
||||
# This Python file uses the following encoding: utf-8
|
||||
import sys
|
||||
import os
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
from %{PySideVersion}.QtGui import QGuiApplication
|
||||
from %{PySideVersion}.QtQml import QQmlApplicationEngine
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QGuiApplication(sys.argv)
|
||||
engine = QQmlApplicationEngine()
|
||||
engine.load(os.path.join(os.path.dirname(__file__), "main.qml"))
|
||||
|
||||
engine.load(os.fspath(Path(__file__).resolve().parent / "main.qml"))
|
||||
if not engine.rootObjects():
|
||||
sys.exit(-1)
|
||||
sys.exit(app.exec_())
|
||||
|
@@ -1,7 +1,7 @@
|
||||
# This Python file uses the following encoding: utf-8
|
||||
import sys
|
||||
import os
|
||||
|
||||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
@if '%{BaseCB}' === 'QWidget'
|
||||
from %{PySideVersion}.QtWidgets import QApplication, QWidget
|
||||
@@ -27,12 +27,13 @@ class %{Class}:
|
||||
|
||||
def load_ui(self):
|
||||
loader = QUiLoader()
|
||||
path = os.path.join(os.path.dirname(__file__), "form.ui")
|
||||
path = os.fspath(Path(__file__).resolve().parent / "form.ui")
|
||||
ui_file = QFile(path)
|
||||
ui_file.open(QFile.ReadOnly)
|
||||
loader.load(ui_file, self)
|
||||
ui_file.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QApplication([])
|
||||
widget = %{Class}()
|
||||
|
@@ -972,7 +972,7 @@ private:
|
||||
continue;
|
||||
}
|
||||
|
||||
auto pushGraphs = [&](int offset, const GraphLine *endline, const QStringView &style) {
|
||||
auto pushGraphs = [&](int offset, const GraphLine *endline, QStringView style) {
|
||||
for (GraphLine *pline = m_regionGraph.data(); pline <= endline; ++pline) {
|
||||
// a label can hide a graph
|
||||
if (pline->graphLineLength <= offset) {
|
||||
@@ -1156,14 +1156,18 @@ void AnsiHighlighter::setOutputFile(const QString &fileName)
|
||||
return;
|
||||
}
|
||||
d->out.setDevice(&d->file);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
d->out.setCodec("UTF-8");
|
||||
#endif
|
||||
}
|
||||
|
||||
void AnsiHighlighter::setOutputFile(FILE *fileHandle)
|
||||
{
|
||||
d->file.open(fileHandle, QIODevice::WriteOnly);
|
||||
d->out.setDevice(&d->file);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
d->out.setCodec("UTF-8");
|
||||
#endif
|
||||
}
|
||||
|
||||
void AnsiHighlighter::highlightFile(const QString &fileName, AnsiFormat format, bool useEditorBackground, TraceOptions traceOptions)
|
||||
@@ -1287,7 +1291,9 @@ void AnsiHighlighter::highlightData(QIODevice *dev, AnsiFormat format, bool useE
|
||||
}
|
||||
|
||||
QTextStream in(dev);
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
in.setCodec("UTF-8");
|
||||
#endif
|
||||
|
||||
if (!traceOptions) {
|
||||
State state;
|
||||
|
@@ -27,7 +27,7 @@ Context *ContextSwitch::context() const
|
||||
return m_context;
|
||||
}
|
||||
|
||||
void ContextSwitch::parse(const QStringView &contextInstr)
|
||||
void ContextSwitch::parse(QStringView contextInstr)
|
||||
{
|
||||
if (contextInstr.isEmpty() || contextInstr == QLatin1String("#stay"))
|
||||
return;
|
||||
|
@@ -25,7 +25,7 @@ public:
|
||||
int popCount() const;
|
||||
Context *context() const;
|
||||
|
||||
void parse(const QStringView &contextInstr);
|
||||
void parse(QStringView contextInstr);
|
||||
void resolve(const Definition &def);
|
||||
|
||||
private:
|
||||
|
@@ -765,7 +765,7 @@ void DefinitionData::loadSpellchecking(QXmlStreamReader &reader)
|
||||
}
|
||||
}
|
||||
|
||||
bool DefinitionData::checkKateVersion(const QStringView &verStr)
|
||||
bool DefinitionData::checkKateVersion(QStringView verStr)
|
||||
{
|
||||
const auto idx = verStr.indexOf(QLatin1Char('.'));
|
||||
if (idx <= 0) {
|
||||
|
@@ -53,7 +53,7 @@ public:
|
||||
void loadComments(QXmlStreamReader &reader);
|
||||
void loadFoldingIgnoreList(QXmlStreamReader &reader);
|
||||
void loadSpellchecking(QXmlStreamReader &reader);
|
||||
bool checkKateVersion(const QStringView &verStr);
|
||||
bool checkKateVersion(QStringView verStr);
|
||||
|
||||
void resolveIncludeKeywords();
|
||||
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
using namespace KSyntaxHighlighting;
|
||||
|
||||
static Theme::TextStyle stringToDefaultFormat(const QStringView &str)
|
||||
static Theme::TextStyle stringToDefaultFormat(QStringView str)
|
||||
{
|
||||
if (!str.startsWith(QLatin1String("ds")))
|
||||
return Theme::Normal;
|
||||
|
@@ -130,9 +130,7 @@ void HtmlHighlighter::highlightData(QIODevice *dev, const QString &title)
|
||||
*d->out << "\"><pre>\n";
|
||||
|
||||
QTextStream in(dev);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
in.setEncoding(QStringConverter::Utf8);
|
||||
#else
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
in.setCodec("UTF-8");
|
||||
#endif
|
||||
while (!in.atEnd()) {
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
using namespace KSyntaxHighlighting;
|
||||
|
||||
bool KeywordList::contains(const QStringView &str, Qt::CaseSensitivity caseSensitive) const
|
||||
bool KeywordList::contains(QStringView str, Qt::CaseSensitivity caseSensitive) const
|
||||
{
|
||||
/**
|
||||
* get right vector to search in
|
||||
@@ -26,7 +26,7 @@ bool KeywordList::contains(const QStringView &str, Qt::CaseSensitivity caseSensi
|
||||
/**
|
||||
* search with right predicate
|
||||
*/
|
||||
return std::binary_search(vectorToSearch.begin(), vectorToSearch.end(), QStringView(str), [caseSensitive](const QStringView &a, const QStringView &b) {
|
||||
return std::binary_search(vectorToSearch.begin(), vectorToSearch.end(), QStringView(str), [caseSensitive](QStringView a, QStringView b) {
|
||||
return a.compare(b, caseSensitive) < 0;
|
||||
});
|
||||
}
|
||||
@@ -92,7 +92,7 @@ void KeywordList::initLookupForCaseSensitivity(Qt::CaseSensitivity caseSensitive
|
||||
/**
|
||||
* sort with right predicate
|
||||
*/
|
||||
std::sort(vectorToSort.begin(), vectorToSort.end(), [caseSensitive](const QStringView &a, const QStringView &b) {
|
||||
std::sort(vectorToSort.begin(), vectorToSort.end(), [caseSensitive](QStringView a, QStringView b) {
|
||||
return a.compare(b, caseSensitive) < 0;
|
||||
});
|
||||
}
|
||||
|
@@ -53,10 +53,10 @@ public:
|
||||
}
|
||||
|
||||
/** Checks if @p str is a keyword in this list. */
|
||||
bool contains(const QStringView &str) const { return contains(str, m_caseSensitive); }
|
||||
bool contains(QStringView str) const { return contains(str, m_caseSensitive); }
|
||||
|
||||
/** Checks if @p str is a keyword in this list, overriding the global case-sensitivity setting. */
|
||||
bool contains(const QStringView &str, Qt::CaseSensitivity caseSensitive) const;
|
||||
bool contains(QStringView str, Qt::CaseSensitivity caseSensitive) const;
|
||||
|
||||
void load(QXmlStreamReader &reader);
|
||||
void setCaseSensitivity(Qt::CaseSensitivity caseSensitive);
|
||||
|
@@ -182,7 +182,7 @@ void Rule::loadAdditionalWordDelimiters(QXmlStreamReader &reader)
|
||||
m_weakDeliminator = reader.attributes().value(QLatin1String("weakDeliminator")).toString();
|
||||
}
|
||||
|
||||
Rule::Ptr Rule::create(const QStringView &name)
|
||||
Rule::Ptr Rule::create(QStringView name)
|
||||
{
|
||||
if (name == QLatin1String("AnyChar"))
|
||||
return std::make_shared<AnyChar>();
|
||||
|
@@ -89,7 +89,7 @@ public:
|
||||
|
||||
virtual MatchResult doMatch(const QString &text, int offset, const QStringList &captures) const = 0;
|
||||
|
||||
static Rule::Ptr create(const QStringView &name);
|
||||
static Rule::Ptr create(QStringView name);
|
||||
|
||||
protected:
|
||||
virtual bool doLoad(QXmlStreamReader &reader);
|
||||
|
@@ -15,7 +15,7 @@ namespace KSyntaxHighlighting
|
||||
namespace Xml
|
||||
{
|
||||
/** Parse a xs:boolean attribute. */
|
||||
inline bool attrToBool(const QStringView &str)
|
||||
inline bool attrToBool(QStringView str)
|
||||
{
|
||||
return str == QLatin1String("1") || str.compare(QString("true"), Qt::CaseInsensitive) == 0;
|
||||
}
|
||||
|
@@ -39,14 +39,13 @@ class AbstractFilePathView : public Utils::SmallStringView
|
||||
public:
|
||||
constexpr AbstractFilePathView() = default;
|
||||
explicit AbstractFilePathView(const char *const string, const size_type size) noexcept
|
||||
: Utils::SmallStringView(string, size),
|
||||
m_slashIndex(lastSlashIndex(*this))
|
||||
: AbstractFilePathView{Utils::SmallStringView{string, size}}
|
||||
{
|
||||
}
|
||||
|
||||
explicit AbstractFilePathView(Utils::SmallStringView filePath)
|
||||
: Utils::SmallStringView(filePath),
|
||||
m_slashIndex(lastSlashIndex(filePath))
|
||||
: Utils::SmallStringView(filePath)
|
||||
, m_slashIndex(lastSlashIndex(filePath))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -91,9 +90,10 @@ public:
|
||||
constexpr char separator = Utils::HostOsInfo::isWindowsHost() ? WindowsSlash : '/';
|
||||
auto foundReverse = std::find(filePath.rbegin(), filePath.rend(), separator);
|
||||
auto found = foundReverse.base();
|
||||
--found;
|
||||
|
||||
return std::distance(filePath.begin(), found);
|
||||
auto distance = std::distance(filePath.begin(), found);
|
||||
|
||||
return distance - 1;
|
||||
}
|
||||
|
||||
friend bool operator==(const AbstractFilePathView &first, const AbstractFilePathView &second)
|
||||
|
@@ -64,8 +64,8 @@ template<uint Size>
|
||||
class BasicSmallString
|
||||
{
|
||||
public:
|
||||
using iterator = SmallStringView::iterator;
|
||||
using const_iterator = SmallStringView::const_iterator;
|
||||
using const_iterator = Internal::SmallStringIterator<std::random_access_iterator_tag, const char>;
|
||||
using iterator = Internal::SmallStringIterator<std::random_access_iterator_tag, char>;
|
||||
using reverse_iterator = std::reverse_iterator<iterator>;
|
||||
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
||||
using size_type = std::size_t;
|
||||
@@ -116,11 +116,12 @@ public:
|
||||
{}
|
||||
|
||||
explicit BasicSmallString(const_iterator begin, const_iterator end)
|
||||
: BasicSmallString(SmallStringView{begin, end})
|
||||
: BasicSmallString{std::addressof(*begin), static_cast<std::size_t>(std::distance(begin, end))}
|
||||
{}
|
||||
|
||||
explicit BasicSmallString(iterator begin, iterator end)
|
||||
: BasicSmallString(SmallStringView{begin, end})
|
||||
|
||||
: BasicSmallString{std::addressof(*begin), static_cast<std::size_t>(std::distance(begin, end))}
|
||||
{}
|
||||
|
||||
template<typename Type, typename = std::enable_if_t<std::is_pointer<Type>::value>>
|
||||
|
@@ -32,6 +32,7 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace Utils {
|
||||
|
||||
@@ -45,45 +46,24 @@ using enable_if_has_char_data_pointer = typename std::enable_if_t<
|
||||
>, char>::value
|
||||
, int>;
|
||||
|
||||
class SmallStringView
|
||||
class SmallStringView : public std::string_view
|
||||
{
|
||||
public:
|
||||
using const_iterator = Internal::SmallStringIterator<std::random_access_iterator_tag, const char>;
|
||||
using iterator = Internal::SmallStringIterator<std::random_access_iterator_tag, char>;
|
||||
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
||||
using size_type = std::size_t;
|
||||
|
||||
constexpr SmallStringView() = default;
|
||||
|
||||
constexpr SmallStringView(const char *characterPointer) noexcept
|
||||
: m_pointer(characterPointer)
|
||||
, m_size(std::char_traits<char>::length(characterPointer))
|
||||
{}
|
||||
|
||||
constexpr SmallStringView(const char *const string, const size_type size) noexcept
|
||||
: m_pointer(string)
|
||||
, m_size(size)
|
||||
{}
|
||||
|
||||
constexpr SmallStringView(const char *const begin, const char *const end) noexcept
|
||||
: m_pointer(begin)
|
||||
, m_size(static_cast<std::size_t>(std::distance(begin, end)))
|
||||
{}
|
||||
using std::string_view::string_view;
|
||||
|
||||
constexpr SmallStringView(const_iterator begin, const_iterator end) noexcept
|
||||
: m_pointer(begin.data())
|
||||
, m_size(std::size_t(end - begin))
|
||||
: std::string_view{std::addressof(*begin), static_cast<std::size_t>(std::distance(begin, end))}
|
||||
{}
|
||||
|
||||
constexpr SmallStringView(iterator begin, iterator end) noexcept
|
||||
: m_pointer(begin.data())
|
||||
, m_size(std::size_t(end - begin))
|
||||
#ifdef Q_OS_WINDOWS
|
||||
constexpr SmallStringView(const char *const begin, const char *const end) noexcept
|
||||
: std::string_view{begin, static_cast<std::size_t>(std::distance(begin, end))}
|
||||
{}
|
||||
#endif
|
||||
|
||||
template<typename String, typename Utils::enable_if_has_char_data_pointer<String> = 0>
|
||||
constexpr SmallStringView(const String &string) noexcept
|
||||
: m_pointer(string.data())
|
||||
, m_size(string.size())
|
||||
: std::string_view{string.data(), static_cast<std::size_t>(string.size())}
|
||||
{}
|
||||
|
||||
static constexpr SmallStringView fromUtf8(const char *const characterPointer)
|
||||
@@ -91,29 +71,7 @@ public:
|
||||
return SmallStringView(characterPointer);
|
||||
}
|
||||
|
||||
constexpr
|
||||
const char *data() const noexcept
|
||||
{
|
||||
return m_pointer;
|
||||
}
|
||||
|
||||
constexpr
|
||||
size_type size() const noexcept
|
||||
{
|
||||
return m_size;
|
||||
}
|
||||
|
||||
constexpr
|
||||
size_type isEmpty() const noexcept
|
||||
{
|
||||
return m_size == 0;
|
||||
}
|
||||
|
||||
constexpr
|
||||
size_type empty() const noexcept
|
||||
{
|
||||
return m_size == 0;
|
||||
}
|
||||
constexpr size_type isEmpty() const noexcept { return empty(); }
|
||||
|
||||
constexpr
|
||||
SmallStringView mid(size_type position) const noexcept
|
||||
@@ -127,28 +85,6 @@ public:
|
||||
return SmallStringView(data() + position, length);
|
||||
}
|
||||
|
||||
constexpr
|
||||
const_iterator begin() const noexcept
|
||||
{
|
||||
return data();
|
||||
}
|
||||
|
||||
constexpr
|
||||
const_iterator end() const noexcept
|
||||
{
|
||||
return data() + size();
|
||||
}
|
||||
|
||||
constexpr const_reverse_iterator rbegin() const noexcept
|
||||
{
|
||||
return const_reverse_iterator(end());
|
||||
}
|
||||
|
||||
constexpr const_reverse_iterator rend() const noexcept
|
||||
{
|
||||
return const_reverse_iterator(begin());
|
||||
}
|
||||
|
||||
constexpr20 operator std::string() const { return std::string(data(), size()); }
|
||||
|
||||
explicit operator QString() const
|
||||
@@ -159,7 +95,7 @@ public:
|
||||
constexpr bool startsWith(SmallStringView subStringToSearch) const noexcept
|
||||
{
|
||||
if (size() >= subStringToSearch.size())
|
||||
return !std::char_traits<char>::compare(m_pointer,
|
||||
return !std::char_traits<char>::compare(data(),
|
||||
subStringToSearch.data(),
|
||||
subStringToSearch.size());
|
||||
|
||||
@@ -168,16 +104,8 @@ public:
|
||||
|
||||
constexpr bool startsWith(char characterToSearch) const noexcept
|
||||
{
|
||||
return m_pointer[0] == characterToSearch;
|
||||
return *begin() == characterToSearch;
|
||||
}
|
||||
|
||||
constexpr char back() const { return m_pointer[m_size - 1]; }
|
||||
|
||||
constexpr char operator[](std::size_t index) { return m_pointer[index]; }
|
||||
|
||||
private:
|
||||
const char *m_pointer = "";
|
||||
size_type m_size = 0;
|
||||
};
|
||||
|
||||
constexpr bool operator==(SmallStringView first, SmallStringView second) noexcept
|
||||
|
@@ -237,7 +237,7 @@ ClangTextMark::ClangTextMark(const FilePath &fileName,
|
||||
QVector<QAction *> actions;
|
||||
QAction *action = new QAction();
|
||||
action->setIcon(QIcon::fromTheme("edit-copy", Icons::COPY.icon()));
|
||||
action->setToolTip(tr("Copy to Clipboard"));
|
||||
action->setToolTip(QApplication::translate("Clang Code Model Marks", "Copy to Clipboard"));
|
||||
QObject::connect(action, &QAction::triggered, [diagnostic]() {
|
||||
const QString text = ClangDiagnosticWidget::createText({diagnostic},
|
||||
ClangDiagnosticWidget::InfoBar);
|
||||
@@ -250,7 +250,8 @@ ClangTextMark::ClangTextMark(const FilePath &fileName,
|
||||
if (project && isDiagnosticConfigChangable(project, diagnostic)) {
|
||||
action = new QAction();
|
||||
action->setIcon(Icons::BROKEN.icon());
|
||||
action->setToolTip(tr("Disable Diagnostic in Current Project"));
|
||||
action->setToolTip(QApplication::translate("Clang Code Model Marks",
|
||||
"Disable Diagnostic in Current Project"));
|
||||
QObject::connect(action, &QAction::triggered, [diagnostic]() {
|
||||
disableDiagnosticInCurrentProjectConfig(diagnostic);
|
||||
});
|
||||
|
@@ -38,8 +38,10 @@
|
||||
|
||||
#include <android/androidconstants.h>
|
||||
#include <ios/iosconstants.h>
|
||||
#include <webassembly/webassemblyconstants.h>
|
||||
|
||||
#include <coreplugin/find/itemviewfind.h>
|
||||
#include <coreplugin/icore.h>
|
||||
|
||||
#include <projectexplorer/buildaspects.h>
|
||||
#include <projectexplorer/buildinfo.h>
|
||||
@@ -58,6 +60,7 @@
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/categorysortfiltermodel.h>
|
||||
#include <utils/checkablemessagebox.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/headerviewstretcher.h>
|
||||
#include <utils/infolabel.h>
|
||||
@@ -94,11 +97,15 @@ static Q_LOGGING_CATEGORY(cmakeBuildConfigurationLog, "qtc.cmake.bc", QtWarningM
|
||||
const char CONFIGURATION_KEY[] = "CMake.Configuration";
|
||||
const char DEVELOPMENT_TEAM_FLAG[] = "Ios:DevelopmentTeam:Flag";
|
||||
const char PROVISIONING_PROFILE_FLAG[] = "Ios:ProvisioningProfile:Flag";
|
||||
const char CMAKE_QT6_TOOLCHAIN_FILE_ARG[] =
|
||||
"-DCMAKE_TOOLCHAIN_FILE:PATH=%{Qt:QT_INSTALL_PREFIX}/lib/cmake/Qt6/qt.toolchain.cmake";
|
||||
|
||||
namespace Internal {
|
||||
|
||||
class CMakeBuildSettingsWidget : public NamedWidget
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(CMakeProjectManager::Internal::CMakeBuildSettingsWidget)
|
||||
|
||||
public:
|
||||
CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc);
|
||||
|
||||
@@ -178,6 +185,34 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
|
||||
m_configModel->flush(); // clear out config cache...;
|
||||
});
|
||||
|
||||
auto clearCMakeConfiguration = new QPushButton(tr("Re-configure with Initial Parameters"));
|
||||
connect(clearCMakeConfiguration, &QPushButton::clicked, this, [bc]() {
|
||||
auto *settings = CMakeProjectPlugin::projectTypeSpecificSettings();
|
||||
bool doNotAsk{!settings->askBeforeReConfigureInitialParams()};
|
||||
if (!doNotAsk) {
|
||||
QDialogButtonBox::StandardButton reply = Utils::CheckableMessageBox::question(
|
||||
nullptr,
|
||||
tr("Re-configure with Initial Parameters"),
|
||||
tr("Clear CMake configuration and configure with initial parameters?"),
|
||||
tr("Do not ask again"),
|
||||
&doNotAsk,
|
||||
QDialogButtonBox::Yes | QDialogButtonBox::No,
|
||||
QDialogButtonBox::Yes);
|
||||
|
||||
settings->setAskBeforeReConfigureInitialParams(!doNotAsk);
|
||||
settings->toSettings(Core::ICore::settings());
|
||||
|
||||
if (reply != QDialogButtonBox::Yes) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
auto cbc = static_cast<CMakeBuildSystem*>(bc->buildSystem());
|
||||
cbc->clearCMakeCache();
|
||||
if (ProjectExplorerPlugin::saveModifiedFiles())
|
||||
cbc->runCMake();
|
||||
});
|
||||
|
||||
auto buildTypeAspect = bc->aspect<BuildTypeAspect>();
|
||||
connect(buildTypeAspect, &BaseAspect::changed, this, [this, buildTypeAspect]() {
|
||||
if (!m_buildConfiguration->isMultiConfig()) {
|
||||
@@ -309,6 +344,7 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
|
||||
buildDirAspect,
|
||||
bc->aspect<InitialCMakeArgumentsAspect>(),
|
||||
bc->aspect<BuildTypeAspect>(),
|
||||
QString(), clearCMakeConfiguration,
|
||||
qmlDebugAspect
|
||||
},
|
||||
Space(10),
|
||||
@@ -427,7 +463,11 @@ CMakeBuildSettingsWidget::CMakeBuildSettingsWidget(CMakeBuildConfiguration *bc)
|
||||
this, &CMakeBuildSettingsWidget::updateFromKit);
|
||||
connect(m_buildConfiguration, &CMakeBuildConfiguration::enabledChanged,
|
||||
this, [this]() {
|
||||
setError(m_buildConfiguration->disabledReason());
|
||||
if (m_buildConfiguration->isEnabled())
|
||||
setError(QString());
|
||||
|
||||
m_batchEditButton->setEnabled(m_buildConfiguration->isEnabled());
|
||||
m_addButton->setEnabled(m_buildConfiguration->isEnabled());
|
||||
});
|
||||
|
||||
updateSelection();
|
||||
@@ -744,6 +784,11 @@ static bool isIos(const Kit *k)
|
||||
|| deviceType == Ios::Constants::IOS_SIMULATOR_TYPE;
|
||||
}
|
||||
|
||||
static bool isWebAssembly(const Kit *k)
|
||||
{
|
||||
return DeviceTypeKitAspect::deviceTypeId(k) == WebAssembly::Constants::WEBASSEMBLY_DEVICE_TYPE;
|
||||
}
|
||||
|
||||
static QStringList defaultInitialCMakeArguments(const Kit *k, const QString buildType)
|
||||
{
|
||||
// Generator:
|
||||
@@ -909,8 +954,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
|
||||
const QString sysroot = deviceType == Ios::Constants::IOS_DEVICE_TYPE
|
||||
? QLatin1String("iphoneos")
|
||||
: QLatin1String("iphonesimulator");
|
||||
initialArgs.append("-DCMAKE_TOOLCHAIN_FILE:PATH=%{Qt:QT_INSTALL_PREFIX}/lib/cmake/"
|
||||
"Qt6/qt.toolchain.cmake");
|
||||
initialArgs.append(CMAKE_QT6_TOOLCHAIN_FILE_ARG);
|
||||
initialArgs.append("-DCMAKE_OSX_ARCHITECTURES:STRING=" + architecture);
|
||||
initialArgs.append("-DCMAKE_OSX_SYSROOT:STRING=" + sysroot);
|
||||
initialArgs.append("%{" + QLatin1String(DEVELOPMENT_TEAM_FLAG) + "}");
|
||||
@@ -918,6 +962,12 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
|
||||
}
|
||||
}
|
||||
|
||||
if (isWebAssembly(k)) {
|
||||
const QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(k);
|
||||
if (qt && qt->qtVersion().majorVersion >= 6)
|
||||
initialArgs.append(CMAKE_QT6_TOOLCHAIN_FILE_ARG);
|
||||
}
|
||||
|
||||
if (info.buildDirectory.isEmpty()) {
|
||||
setBuildDirectory(shadowBuildDirectory(target->project()->projectFilePath(),
|
||||
k,
|
||||
|
@@ -541,13 +541,18 @@ void CMakeBuildSystem::clearCMakeCache()
|
||||
|
||||
stopParsingAndClearState();
|
||||
|
||||
const FilePath cmakeCache = m_parameters.workDirectory / "CMakeCache.txt";
|
||||
const FilePath cmakeFiles = m_parameters.workDirectory / "CMakeFiles";
|
||||
const QList<FilePath> pathsToDelete = {
|
||||
m_parameters.workDirectory / "CMakeCache.txt",
|
||||
m_parameters.workDirectory / "CMakeCache.txt.prev",
|
||||
m_parameters.workDirectory / "CMakeFiles",
|
||||
m_parameters.workDirectory / ".cmake/api/v1/reply",
|
||||
m_parameters.workDirectory / ".cmake/api/v1/reply.prev"
|
||||
};
|
||||
|
||||
if (cmakeCache.exists())
|
||||
Utils::FileUtils::removeRecursively(cmakeCache);
|
||||
if (cmakeFiles.exists())
|
||||
Utils::FileUtils::removeRecursively(cmakeFiles);
|
||||
for (const FilePath &path : pathsToDelete) {
|
||||
if (path.exists())
|
||||
Utils::FileUtils::removeRecursively(path);
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<CMakeProjectNode> CMakeBuildSystem::generateProjectTree(
|
||||
|
@@ -35,6 +35,8 @@ namespace Internal {
|
||||
|
||||
class CMakeProjectImporter : public QtSupport::QtProjectImporter
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(CMakeProjectManager::Internal::CMakeProjectImporter)
|
||||
|
||||
public:
|
||||
CMakeProjectImporter(const Utils::FilePath &path);
|
||||
|
||||
|
@@ -33,6 +33,7 @@ static const char SETTINGS_KEY[] = "CMakeSpecificSettings";
|
||||
static const char AFTER_ADD_FILE_ACTION_KEY[] = "ProjectPopupSetting";
|
||||
static const char NINJA_PATH[] = "NinjaPath";
|
||||
static const char PACKAGE_MANAGER_AUTO_SETUP[] = "PackageManagerAutoSetup";
|
||||
static const char ASK_RECONFIGURE_INITIAL_PARAMS[] = "AskReConfigureInitialParams";
|
||||
}
|
||||
|
||||
void CMakeSpecificSettings::fromSettings(QSettings *settings)
|
||||
@@ -53,6 +54,7 @@ void CMakeSpecificSettings::toSettings(QSettings *settings) const
|
||||
settings->beginGroup(QString(SETTINGS_KEY));
|
||||
settings->setValue(QString(AFTER_ADD_FILE_ACTION_KEY), static_cast<int>(m_afterAddFileToProjectSetting));
|
||||
settings->setValue(QString(PACKAGE_MANAGER_AUTO_SETUP), m_packageManagerAutoSetup);
|
||||
settings->setValue(QString(ASK_RECONFIGURE_INITIAL_PARAMS), m_askBeforeReConfigureInitialParams);
|
||||
settings->endGroup();
|
||||
}
|
||||
}
|
||||
|
@@ -53,10 +53,13 @@ public:
|
||||
void setPackageManagerAutoSetup(bool checked) { m_packageManagerAutoSetup = checked; }
|
||||
bool packageManagerAutoSetup() const { return m_packageManagerAutoSetup; }
|
||||
|
||||
bool askBeforeReConfigureInitialParams() const { return m_askBeforeReConfigureInitialParams; }
|
||||
void setAskBeforeReConfigureInitialParams(bool doAsk) { m_askBeforeReConfigureInitialParams = doAsk; }
|
||||
private:
|
||||
AfterAddFileAction m_afterAddFileToProjectSetting;
|
||||
Utils::FilePath m_ninjaPath;
|
||||
bool m_packageManagerAutoSetup = true;
|
||||
bool m_askBeforeReConfigureInitialParams = true;
|
||||
};
|
||||
|
||||
}
|
||||
|
@@ -72,6 +72,7 @@ CMakeSpecificSettingWidget::CMakeSpecificSettingWidget(CMakeSpecificSettings *se
|
||||
}
|
||||
|
||||
m_ui.packageManagerAutoSetup->setChecked(settings->packageManagerAutoSetup());
|
||||
m_ui.askBeforeReConfigureWithInitialParams->setChecked(settings->askBeforeReConfigureInitialParams());
|
||||
}
|
||||
|
||||
void CMakeSpecificSettingWidget::apply()
|
||||
@@ -80,6 +81,7 @@ void CMakeSpecificSettingWidget::apply()
|
||||
m_settings->setAfterAddFileSetting(popupSetting == -1 ? AfterAddFileAction::ASK_USER
|
||||
: static_cast<AfterAddFileAction>(popupSetting));
|
||||
m_settings->setPackageManagerAutoSetup(m_ui.packageManagerAutoSetup->isChecked());
|
||||
m_settings->setAskBeforeReConfigureInitialParams(m_ui.askBeforeReConfigureWithInitialParams->isChecked());
|
||||
m_settings->toSettings(Core::ICore::settings());
|
||||
}
|
||||
|
||||
|
@@ -70,6 +70,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="askBeforeReConfigureWithInitialParams">
|
||||
<property name="text">
|
||||
<string>Ask before re-configuring with initial parameters</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
@@ -896,7 +896,21 @@ FileApiData FileApiParser::parseData(const QFileInfo &replyFileInfo, const QStri
|
||||
return QString::compare(cfg.name, cmakeBuildType, Qt::CaseInsensitive) == 0;
|
||||
});
|
||||
if (it == codeModels.cend()) {
|
||||
errorMessage = QString("No '%1' CMake configuration found!").arg(cmakeBuildType);
|
||||
QStringList buildTypes;
|
||||
for (const Configuration &cfg: codeModels)
|
||||
buildTypes << cfg.name;
|
||||
|
||||
if (result.replyFile.isMultiConfig) {
|
||||
errorMessage = tr("No \"%1\" CMake configuration found. Available configurations: \"%2\".\n"
|
||||
"Make sure that CMAKE_CONFIGURATION_TYPES variable contains the \"Build type\" field.")
|
||||
.arg(cmakeBuildType)
|
||||
.arg(buildTypes.join(", "));
|
||||
} else {
|
||||
errorMessage = tr("No \"%1\" CMake configuration found. Available configuration: \"%2\".\n"
|
||||
"Make sure that CMAKE_BUILD_TYPE variable matches the \"Build type\" field.")
|
||||
.arg(cmakeBuildType)
|
||||
.arg(buildTypes.join(", "));
|
||||
}
|
||||
qWarning() << errorMessage;
|
||||
return result;
|
||||
}
|
||||
|
@@ -245,6 +245,7 @@ public:
|
||||
|
||||
class FileApiParser
|
||||
{
|
||||
Q_DECLARE_TR_FUNCTIONS(FileApiParser)
|
||||
public:
|
||||
static FileApiData parseData(const QFileInfo &replyFileInfo, const QString& cmakeBuildType,
|
||||
QString &errorMessage);
|
||||
|
@@ -125,11 +125,12 @@ static const char preferredEditorFactoriesKey[] = "EditorManager/PreferredEditor
|
||||
|
||||
static const char scratchBufferKey[] = "_q_emScratchBuffer";
|
||||
|
||||
// for lupdate
|
||||
using namespace Core;
|
||||
|
||||
using namespace Core::Internal;
|
||||
using namespace Utils;
|
||||
|
||||
namespace Core {
|
||||
|
||||
//===================EditorManager=====================
|
||||
|
||||
/*!
|
||||
@@ -3876,5 +3877,3 @@ void CorePlugin::testSplitLineAndColumnNumber_data()
|
||||
}
|
||||
|
||||
#endif // WITH_TESTS
|
||||
|
||||
} // namespace Core
|
||||
|
@@ -8530,7 +8530,7 @@ public:
|
||||
if (orientation == Qt::Horizontal && role == Qt::DisplayRole) {
|
||||
switch (section) {
|
||||
case 0:
|
||||
return tr("Base Class Constructors");
|
||||
return CppQuickFixFactory::tr("Base Class Constructors");
|
||||
}
|
||||
}
|
||||
return {};
|
||||
|
@@ -177,13 +177,13 @@ class Filter : public Core::SearchResultFilter
|
||||
const auto widget = new QWidget;
|
||||
const auto layout = new QVBoxLayout(widget);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
const auto readsCheckBox = new QCheckBox(tr("Reads"));
|
||||
const auto readsCheckBox = new QCheckBox(CppFindReferences::tr("Reads"));
|
||||
readsCheckBox->setChecked(m_showReads);
|
||||
const auto writesCheckBox = new QCheckBox(tr("Writes"));
|
||||
const auto writesCheckBox = new QCheckBox(CppFindReferences::tr("Writes"));
|
||||
writesCheckBox->setChecked(m_showWrites);
|
||||
const auto declsCheckBox = new QCheckBox(tr("Declarations"));
|
||||
const auto declsCheckBox = new QCheckBox(CppFindReferences::tr("Declarations"));
|
||||
declsCheckBox->setChecked(m_showDecls);
|
||||
const auto otherCheckBox = new QCheckBox(tr("Other"));
|
||||
const auto otherCheckBox = new QCheckBox(CppFindReferences::tr("Other"));
|
||||
otherCheckBox->setChecked(m_showOther);
|
||||
layout->addWidget(readsCheckBox);
|
||||
layout->addWidget(writesCheckBox);
|
||||
|
@@ -193,7 +193,7 @@ LanguageClientSettingsPageWidget::LanguageClientSettingsPageWidget(LanguageClien
|
||||
auto addMenu = new QMenu;
|
||||
addMenu->clear();
|
||||
for (const ClientType &type : clientTypes()) {
|
||||
auto action = new QAction(tr("New %1").arg(type.name));
|
||||
auto action = new QAction(LanguageClientSettingsPage::tr("New %1").arg(type.name));
|
||||
connect(action, &QAction::triggered, this, [this, id = type.id]() { addItem(id); });
|
||||
addMenu->addAction(action);
|
||||
}
|
||||
|