Merge remote-tracking branch 'origin/4.13' into master

Conflicts:
	share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ListViewSpecifics.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/MouseAreaSpecifics.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FlickableSection.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontSection.qml
	share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/StandardTextSection.qml

Change-Id: Ie5deacd39ae4f3c0966e7cb41a8fd832dcefbb09
This commit is contained in:
Eike Ziller
2020-09-03 11:17:12 +02:00
82 changed files with 4830 additions and 1429 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@@ -100,7 +100,7 @@
\li GCC, Clang
\li LLDB, FSF GDB (experimental)
\row
\li Windows/MinGW
\li Windows/\MinGW
\li GCC
\li GDB
\row
@@ -173,7 +173,7 @@
\section2 GDB
On Windows, use the Python-enabled GDB version that is bundled
with the Qt package or comes with recent versions of MinGW. On
with the Qt package or comes with recent versions of \MinGW. On
most Linux distributions, the GDB builds shipped with the system
are sufficient.

View File

@@ -136,7 +136,7 @@
In general, \key F5 and the \uicontrol {Start Debugging of Startup Project}
button are set up in a
way to start the operating mode that is commonly used in a given context. So
if the current project is set up as a C++ application using the MinGW
if the current project is set up as a C++ application using the \MinGW
toolchain targeting desktop Windows, the GDB engine will be started in Start
Internal mode. If the current project is a QML application using C++
plugins, a "mixed" QML/C++ engine will be started, with the C++ parts being

View File

@@ -46,7 +46,7 @@
For more information about where the files are located on each supported
platform, see \l {Location of Settings Files}.
\b {\QC comes with MinGW, should I use this version with Qt?}
\b {\QC comes with \MinGW, should I use this version with Qt?}
Use the version that was built against the Qt version.

View File

@@ -57,9 +57,9 @@
\li GNU Compiler Collection (GCC) is a compiler for Linux and
\macos.
\li MinGW (Minimalist GNU for Windows) is a native software port of GCC
\li \MinGW (Minimalist GNU for Windows) is a native software port of GCC
and GNU Binutils for use in the development of native Microsoft
Windows applications on Windows. MinGW is
Windows applications on Windows. \MinGW is
distributed together with \QC and Qt installers for Windows.
\li ICC (Intel C++ Compiler) is a group of C and C++ compilers.
@@ -114,7 +114,7 @@
\section1 Specifying Compiler Settings
To build an application using GCC, MinGW, Clang, or QCC, specify the path
To build an application using GCC, \MinGW, Clang, or QCC, specify the path
to the directory where the compiler is located and select
the application binary interface (ABI) version from the list of available
versions. You can also create a custom ABI definition.
@@ -215,7 +215,7 @@
see \l{Using Custom Output Parsers}.
\endlist
\section1 Troubleshooting MinGW Compilation Errors
\section1 Troubleshooting \MinGW Compilation Errors
If error messages displayed in the \uicontrol {Compile Output} pane contain
paths where slashes are missing (for example, \c {C:QtSDK}),
@@ -228,7 +228,7 @@
\endcode
If these commands show paths, they have been added to the global PATH
variable during the installation of a tool chain based on Cygwin or MinGW,
variable during the installation of a tool chain based on Cygwin or \MinGW,
even though this is against Windows conventions.
To keep working with the third-party tool chain, create a new shell link

View File

@@ -136,7 +136,10 @@
\li \l{Adding Models}
\li \l{Using Materials and Shaders}
\li \l{Attaching Textures to Materials}
\li \l{Using 3D Materials}
\li \l{Applying 3D Effects}
\li \l{Using Custom Shaders}
\li \l{Creating Custom Effects and Materials}
\li \l{Using Lights}
\li \l{Using Scene Camera}
\li \l{Setting Scene Environment}

View File

@@ -60,9 +60,9 @@
\uicontrol Properties view.
\li Drag and drop a \uicontrol Rectangle from the \uicontrol Library to
the item in the navigator. This creates a nested item where the
item is the parent of the rectangle. Items are positioned relative
to their parents.
the item in \uicontrol Navigator. This creates a nested item where
the item is the parent of the rectangle. Items are positioned
relative to their parents.
\li In the \uicontrol Properties view, modify the appearance of the
rectangle:
@@ -71,8 +71,8 @@
\li In the \uicontrol Color field, select the button color.
\li In the \uicontrol Radius field, use the slider to set the radius of
the rectangle and produce rounded corners for the button.
\li In the \uicontrol Radius field, set the radius of
the rectangle to produce rounded corners for the button.
\li Select \uicontrol {Layout}, and then select the
\inlineimage anchor-fill.png
@@ -82,14 +82,15 @@
\endlist
\li Drag and drop a \uicontrol {Text} type to the item in the navigator.
\li Drag and drop a \uicontrol {Text} type to the item in
\uicontrol Navigator.
\li In the \uicontrol Properties view, edit the properties of the \uicontrol Text
type.
\list a
\li In the \uicontrol Text field, type \b Button.
\li In the \uicontrol Text field, enter \e Button.
You can select the text color in the \uicontrol {Text color} field and the
font, size, and style in the
@@ -109,10 +110,17 @@
\endlist
To be useful, the button type has to be created in a project.
When you work on other QML files in the project to create screens
or other components for the UI, the button type appears in the
\uicontrol {My QML Components} tab of the \uicontrol Library view.
You can use it to create button instances and modify their properties
to assign them useful IDs, change their appearance, and set the button
text for each button instance, for example.
To create a graphical button that scales beautifully without using vector
graphics, use the \l [QML]{BorderImage}{Border Image} type. For more
information, see \l{Creating Scalable Buttons and Borders}.
*/
@@ -126,166 +134,147 @@
You can use the \l [QML]{BorderImage}{Border Image} type to display an
image, such as a PNG file, as a border and a background.
Use two border images and suitable graphics to make it look like the
button is pushed down when it is clicked. One of the border images
is visible by default. You can specify that it is hidden and the other one
becomes visible when the mouse is clicked.
Use two border images and suitable graphics to change the appearance of
a button when it is clicked. You can use use \l{Adding States}{states}
to determine which image is visible depending on whether the mouse
button is pressed down. You could add more images and states to
change the appearance of the button depending on other mouse events,
such as hovered.
Add a \l [QML]{MouseArea}{Mouse Area} type that covers the whole area and
emits the clicked signal (\c {item.clicked()}) when it detects a mouse
click.
reacts to mouse events.
You can add text to the button and set it up as a property. The text can
then be initialized from the outside, making the button a reusable UI
component. The font size is also available in case the default size is too
big. You can scale down the button text and use smooth text rendering for
some extra quality.
You can use states also to change the button text color and font size. For
example, you can scale the button text up or down.
\image qmldesigner-borderimage.png "Graphical button"
\image qmldesigner-borderimage-type.png "Button type in Form Editor and States"
To create a graphical button:
\section1 Creating the Button Type
To create a button type, select \uicontrol File >
\uicontrol {New File or Project} >
\if defined(qtcreator)
\uicontrol Qt > \uicontrol {QML File (Qt Quick 2)} >
\else
\uicontrol {Qt Quick Files} > \uicontrol {Qt Quick File} >
\endif
\uicontrol Choose to create a QML file called Button.qml (for example).
\note Types are listed in the \uicontrol Library only if the
filename begins with a capital letter.
\section1 Constructing the Button Component
To construct the button component:
\list 1
\li Select \uicontrol File > \uicontrol {New File or Project} >
\if defined(qtcreator)
\uicontrol Qt > \uicontrol {QML File (Qt Quick 2)} >
\else
\uicontrol {Qt Quick Files} > \uicontrol {Qt Quick File} >
\endif
\uicontrol Choose to create a QML file called Button.qml (for
example).
\note Types are listed in the \uicontrol Library only if the
filename begins with a capital letter.
\li Click \uicontrol {Design} to edit the file in the
\li Click \uicontrol {Design} to edit the QML file in the
\uicontrol {Form Editor}.
\li In the \uicontrol Navigator, select \uicontrol Item and set the
\li In the \uicontrol {Assets} tab of \uicontrol Library, select
\uicontrol {Add New Assets} to copy the image files you want
to use to the project folder.
\li In the \uicontrol Navigator, select the root item and set the
width (\uicontrol W) and height (\uicontrol H) of the button in the
\uicontrol Properties view.
\li Select \uicontrol Connections > \uicontrol {Properties} >
\uicontrol Add to add properties for the item:
\image qmldesigner-borderimage-properties.png "Properties"
\uicontrol Properties view to match the size of the images
you plan to use. This specifies the initial size of the button
component.
\li Drag and drop two \uicontrol {Border Image} types from
\uicontrol Library to the root item in \uicontrol Navigator.
\li Drag and drop a \uicontrol Text type to the root item.
\li Drag and drop a \uicontrol {Mouse Area} to the root item in
\uicontrol Navigator.
\li Select a border image to edit the values of its properties:
\list a
\li Double-click in the columns in the view to specify a \c text
property with the type \c string and an empty value.
\li Specify another property, \c fontSize, with the type \c int
and the value \c 10.
\li In the \uicontrol Id field, enter an ID for the border
image. In this example, we use the ID \e inactiveButton.
\li In the \uicontrol Source field, select the image file for
the border image. For example, inactive_button.png.
\li In the \uicontrol {Layout} tab, select the
\inlineimage anchor-fill.png
(\uicontrol {Fill to Parent}) button to always make the
image the same size as its parent. This makes the button
component scalable, because the image size is bound to the
component size.
\endlist
\li Select the other border image to edit the values of its properties
similarly:
\list a
\li In the \uicontrol Id field, enter \e activeButton.
\li In the \uicontrol Source field, select the image file
for the button when it is clicked. For example,
active_button.png.
\li In the \uicontrol {Layout} tab, select the
\inlineimage anchor-fill.png
(\uicontrol {Fill to Parent}) button.
\endlist
\li Select the text item to specify font size and color in
\uicontrol Properties:
\list a
\li In the \uicontrol Color field, use
the color picker to select the font color, or enter a value
in the field.
\li In \uicontrol Font group, \uicontrol Size field, enter the
font size.
\li In the \uicontrol {Layout} tab, select
\inlineimage anchor-vertical-center.png
(\uicontrol {Vertical Center}) and
\inlineimage anchor-horizontal-center.png
(\uicontrol {Horizontal Center}) buttons to inherit the
vertical and horizontal centering from the parent.
This ensures that the button label is centered when the
component is resized.
\endlist
\li Drag and drop two \uicontrol {Border Image} types from the
\uicontrol Library to the item in the \uicontrol Navigator.
\li Drag and drop a \uicontrol Text type to the item in the navigator.
\li Drag and drop a \uicontrol {Mouse Area} to the item in the
navigator.
\li In the navigator, select a border image to specify settings for it
in the \uicontrol Properties view:
\list a
\li Select \uicontrol Connections > \uicontrol {Bindings}
> \uicontrol Add to hide the image when the mouse button is not
pressed down. Specify the \c visible property with the
\c !mouseArea source item and \c pressed source property.
\image qmldesigner-borderimage-bindings.png "Border image bindings"
\li In the \uicontrol Source field, select the image file for the button,
for example button_up.png.
\li Click \uicontrol {Layout}, and then click the
\inlineimage anchor-fill.png
(\uicontrol {Fill to Parent}) button to anchor the border image to the
\uicontrol Item.
\endlist
\li Select the other border image to specify similar settings for it:
\list a
\li In \uicontrol Bindings, specify the \c visible property
with the \c mouseArea source item and \c pressed source
property to show the image when the mouse button is pressed
down.
\li In the \uicontrol Source field, select the image file for the button
when it is clicked, for example button_down.png.
\li Select \uicontrol {Layout} > \uicontrol {Fill to Parent}
button to anchor the border image to the \uicontrol Item.
\endlist
\li Select the text to specify font size and color, and text scaling
and rendering:
\list a
\li In the \uicontrol Color field, use the color picker to select
the font color, or enter a value in the field.
\li In \uicontrol Bindings, create bindings to properties:
\image qmldesigner-borderimage-bindings-text.png "Text bindings"
\list
\li Set the source property of the \c text property as
\c text and the source item as \c parent.
\li Set the source property of the \c font.pixelSize as
\c fontSize and the source item as \c parent.
\li Set the source property of \c scale as
\c {if (!mouseArea} and the source item as
\c {pressed) { 1 } else { 0.95 }}.
\endlist
\li Click \uicontrol {Layout}, and then click the
\inlineimage anchor-vertical-center.png
(\uicontrol {Vertical Center}) and
\inlineimage anchor-horizontal-center.png
(\uicontrol {Horizontal Center}) buttons to inherit the
vertical and horizontal centering from the parent.
\endlist
\li Select \uicontrol mouseArea in the navigator and then select
\uicontrol Connections > \uicontrol Add to set \c item.clicked()
as the value of the \c onClicked signal handler.
\image qmldesigner-borderimage-connections.png "Item connections"
\li In the \uicontrol {Text Editor}, specify the \c clicked signal for
the Item:
\qml
Item {
id: item
property string text: ""
property int fontSize: 10
signal clicked
}
\endqml
\endlist
\note To test the button, add it to a Qt Quick Application or Qt
Quick UI project and run the application.
\section1 Using States to Change Component Property Values
\list 1
\li In the \uicontrol States view, select \inlineimage plus.png
twice to create two new states.
\image qmldesigner-borderimage-states.png "Active and inactive states"
\li Select \uicontrol State1.
\li Change the state name to \e active.
\li Select \inlineimage icons/action-icon.png
, and then select \uicontrol {Set when Condition} to determine
when the state should be applied.
\li In the \uicontrol {Binding Editor}, select the \c mouseArea
type and the \c pressed signal to specify that the state is
applied when the mouse button is pressed down.
\image qmldesigner-borderimage-bindings.png "Active state when condition"
\li Select the text item in \uicontrol Navigator to specify that the
text size is scaled up when the button is pressed down.
\li In \uicontrol Properties, select the \uicontrol Advanced tab, and
increase the value of the \uicontrol Scale property.
\li Select \e inactiveButton in \uicontrol Navigator to hide
it in the \e active state by changing the value of its
\uicontrol Visibility property in \uicontrol Properties.
\li Select \uicontrol State2.
\li Change the state name to \e inactive.
\li Set the when condition for the state to \c !mouseArea.pressed to
specify that the state is applied when the mouse button is not
pressed down.
\image qmldesigner-borderimage-bindings1.png "Inactive state when condition"
it in the \e inactive state by changing the value of its
\uicontrol Visibility property in \uicontrol Properties.
\li Press \key {Ctrl+S} to save the button.
\li Select the \inlineimage live_preview.png
(\uicontrol {Show Live Preview}) button to check how the
button behaves when you click it. You can drag the preview
window borders to see what happens when you resize the
component.
\endlist
To be useful, the button type has to be created in a project.
When you work on other QML files in the project to create screens
or other components for the UI, the button type appears in the
\uicontrol {My QML Components} tab of the \uicontrol Library view.
You can drag and drop it to \uicontrol {Form Editor} or
\uicontrol Navigator to create button instances and modify the values
of their properties to assign them useful IDs, change their appearance,
and set the button text for each button instance, for example.
For more information about positioning buttons on screens, see
\l{Positioning Items in UIs}.
\image qmldesigner-borderimage.png "Button preview as part of a screen"
*/

View File

@@ -52,7 +52,7 @@
\list
\li Qt for WebAssembly 5.13.1, or later
\li On Windows: \l{http://wiki.qt.io/MinGW}{MinGW} 7.3.0, or later
\li On Windows: \l{http://wiki.qt.io/MinGW}{\MinGW} 7.3.0, or later
\li \l{https://emscripten.org/docs/introducing_emscripten/index.html}
{emscripten} tool chain for compiling to WebAssembly
\li \c sed stream editor

View File

@@ -137,7 +137,7 @@
The \QC that is included in pre-built Qt packages on Windows is built with
the Microsoft Visual Studio compiler, whereas the version of Qt shipped for
building applications is configured and built to use the MinGW/g++ compiler.
building applications is configured and built to use the \MinGW/g++ compiler.
Plugins built by using this version of Qt cannot be loaded by \QC because
the build-keys do not match. The plugins can only be used in the standalone
version of \QD. Choose \uicontrol Help > \uicontrol {About \QC} to check the
@@ -145,7 +145,7 @@
To use \QD plugins that were built for the shipped Qt version, make sure
that \QC is built with the same compiler by either recompiling \QC using
MinGW or recompiling Qt with Microsoft Visual Studio, depending on which
\MinGW or recompiling Qt with Microsoft Visual Studio, depending on which
configuration you want to use for your applications.
*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -46,30 +46,40 @@
that you don't want to be part of the final UI, to avoid cluttering
the \QDS project. The QML code generated in \QDS corresponds to the
structure of your Sketch document.
\li \QBSK supports document \e symbols and \e {symbol overrides}. Each
symbol is exported as a QML component, and each symbol instance is
generated as a respective \e component instance in the generated
QML. The symbol overrides are exported as values of properties for
the components. For example, if you use symbol overrides to specify
the text for each button instance, it is exported as a value of the
text property.
\li \QBSK supports document \e symbols and \e {symbol overrides} for
text symbols. Each symbol is exported as a QML component, and each
symbol instance is generated as a respective \e component instance
in the generated QML. The symbol overrides are exported as values of
properties for the components. For example, if you use symbol
overrides to specify the text for each button instance, it is
exported as a value of the text property.
\li Create components in Sketch and export them to \QDS before you
start making instances of them. In \QDS, add functionality to the
components, such as button states and then bring them back to Sketch
as assets. If you use functional QML components in Sketch, you will
find it easier to merge new iterations of the design to \QDS and
continue to build the screens there.
\li Use descriptive and unique ids to avoid duplicate QML ids after
exporting assets and \l{Importing 2D Assets}{importing} them to
\QDS.
\li Store all assets in the scalable vector graphics (SVG) format
to be able to easily rescale them for different screen sizes
and resolutions. You can export assets into JPG, PNG, or SVG format
and select options for optimizing them during the export.
\endlist
To use the fonts that you use in Sketch also in \QDS, you need to load
them to \QDS. \QDS deploys them to devices when you preview the UI. For more
information, see \l{Using Custom Fonts}.
To use the fonts that you use in Sketch also in \QDS, you need to import
them to \QDS as assets. \QDS deploys them to devices when you preview the
UI. For more information, see \l{Using Custom Fonts}.
For more information, watch videos about using \QBSK:
For more information, see the \QBSK tutorials that are also accessible from
the \uicontrol Tutorials tab of the Welcome mode:
\list
\li \l{https://youtu.be/oLdEJMoE7l8}
{Webinar: Turn your Sketch UI Designs Into Code with Qt Design Studio}
\li \l{https://youtu.be/qQM2oEWRBOw}
{Talk: Turn Sketch or Photoshop UI designs into working prototypes}
\li \l{https://www.qt.io/blog/qt-design-studio-sketch-bridge-tutorial-part-1}
{Sketch Bridge Tutorial Part 1}
\li \l{https://www.qt.io/blog/qt-design-studio-sketch-bridge-tutorial-part-2}
{Sketch Bridge Tutorial Part 2}
\endlist
\section2 Using Artboards
@@ -94,6 +104,9 @@
import them as QML files and images that you can drag and drop to the
\uicontrol {Form Editor} in \QDS Design mode while creating a UI.
If you want to use the assets on an artboard in \QDS as they are in Sketch,
you can import the artboard without generating QML code for it.
\section2 Using Layers and Groups
When you use \QBSK to export your designs, you will determine how you want
@@ -105,6 +118,21 @@
You can select the asset format and DPI to use for each image in
\uicontrol Settings > \uicontrol {Asset Settings}.
\section2 Using QML Ids
The most common issues in using \QBSK are caused by having duplicate ids in
your project. Even though the importer in \QDS is capable of detecting and
retaining QML ids, you should still manually check all the QML ids to make
them unique and descriptive.
Name the layers in exactly the same way as your QML ids, to be able to find
artwork later, especially as the export files can grow very large and
complicated as they approach the level of a complete UI project.
\note Even though \QDS is capable of handling the ids during merges, we
recommend that you do not change the ids after the first time you export
the assets, to avoid problems.
\section1 Exporting Assets
By default, assets are exported as follows:
@@ -143,9 +171,9 @@
\list 1
\li \QBSK automatically proposes identifiers for all groups and layers
that you can change in the \uicontrol {QML ID} field. The ids will
be made unique when the layer and the respective artwork is imported
into \QDS.
that you can change in the \uicontrol {QML ID} field. Use unique and
descriptive ids to avoid duplicate QML ids when the layer and the
respective artwork is imported into \QDS.
\li In the \uicontrol {Export As} field, select the export type for the
group or layer:
\list

View File

@@ -38,7 +38,7 @@
\QDS is available in binary packages for the following operating systems:
\list
\li \macos 10.13 and 10.14.x
\li \macOS 10.13 and 10.14.x
\li Ubuntu Linux 18.04
\li Windows 10
\endlist

View File

@@ -108,6 +108,8 @@
\li \l{Using Materials and Shaders}
\li \l{Attaching Textures to Materials}
\li \l{Applying 3D Effects}
\li \l{Using Custom Shaders}
\li \l{Creating Custom Effects and Materials}
\li \l{Using Lights}
\li \l{Using Scene Camera}
\li \l{Setting Scene Environment}

View File

@@ -58,10 +58,26 @@
You can use a Texture component to specify an image and how it is
mapped to meshes in a 3D scene. Texture components can use image
data either from a file or a Qt Quick QML type.
\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
effects.
\li \l {Using Custom Shaders}
You can use 3D shader utilities to construct your own effects and
materials.
\li \l{Creating Custom Effects and Materials}
If the ready-made 3D effects and materials don't meet your needs,
you can use 3D shader utilities to construct your own effects and
materials.
\li \l{Using Lights}
You can use several light types as the source of lighting in a

View File

@@ -0,0 +1,163 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Design Studio.
**
** $QT_BEGIN_LICENSE:FDL$
** 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.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\page studio-3d-custom-effects-materials.html
\previouspage studio-3d-custom-shaders.html
\nextpage studio-3d-lights.html
\title Creating Custom Effects and Materials
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 the
\l{Qt Quick 3D Effects QML Types}{Qt Quick 3D Effects} and
\l{Qt Quick 3D Materials QML Types}{Qt Quick 3D Materials} modules to your
project. These modules contain a set of ready-made effects and materials
that you can apply to 3D models.
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"
\note You must create the actual shader source files with some other tool
and copy them to your project folder. You can then specify the source file
names in the custom effect or material properties.
\section1 Creating Custom Effects
By default, a custom effect component contains a Pass type and a Shader
type in the fragment stage. You can add passes, shaders, and other shader
utilities to the effect.
\image studio-qtquick-3d-custom-effect-navigator.png "Custom effect in Navigator"
The fragment shader component is created with a placeholder for the path
to the shader file. Specify the path to the shader file to use in the
shader properties.
To create a custom effect:
\list 1
\li Drag and drop an \uicontrol {Effect} type from the
\uicontrol {Qt Quick 3D Custom Shader Utils} tab of
\uicontrol Library to a Model component in \uicontrol Navigator.
\li Select the custom effect component in \uicontrol Navigator to edit
the values of its properties in the \uicontrol Properties view.
\image studio-qtquick-3d-custom-effect.png "Custom effect properties"
\li In the \uicontrol Passes field, select the pass components for
the effect.
\li Select the pass component in \uicontrol Navigator to specify values
for its properties in \uicontrol Properties.
\image studio-qtquick-3d-pass.png "Pass properties"
\li To execute commands during the pass, drag and drop the following
command types from \uicontrol Library to the custom material in
\uicontrol Navigator: \uicontrol Blending, \uicontrol {Buffer Blit},
\uicontrol {Buffer Input}, \uicontrol {Cull Mode},
\uicontrol {Depth Input}, \uicontrol {Render State}, and
\uicontrol {Set Uniform Value}. Then select the commands in the
\uicontrol Commands field.
\li To allocate a buffer for the pass, drag and drop a \uicontrol Buffer
type to the custom material. Then select the buffer in the
\uicontrol Buffer field.
\li Select the shader component in \uicontrol Navigator to set the path
to the shader files in the \uicontrol Source field in
\uicontrol Properties.
\image studio-qtquick-3d-shader-properties.png "Shader properties"
\endlist
\section1 Creating Custom Materials
By default, a Custom Material component contains two Shader types, a Shader
Info type, and a Pass type. You can add shaders, passes, and other shader
utilities to the material.
\image studio-qtquick-3d-custom-material-navigator.png "Custom material in Navigator"
By default, fragment and vertex shaders are created with placeholders for
the paths to the shader files. Specify the paths to the shader files to use
in the shader properties.
The Shader Info type specifies the shader type and version, as well
as the options used by the shader based on the selected shader key values,
such as diffuse or specular lighting, refraction, transparency, displacement,
transmissiveness, glossiness, and alpha cutout.
The shaders are used with the Pass type to create the resulting material.
A pass can contain multiple rendering passes and other commands. You can
use a Buffer type to allocate a buffer for storing intermediate rendering
results.
To create a custom material:
\list 1
\li Drag and drop a \uicontrol {Custom Material} type from the
\uicontrol {Qt Quick 3D Custom Shader Utils} tab of
\uicontrol Library to a Model component in \uicontrol Navigator.
\li Select the custom material component in \uicontrol Navigator to
edit the values of its properties in the \uicontrol Properties view.
\image studio-qtquick-3d-custom-material.png "Custom material properties"
\li Select the \uicontrol Transparency check box to make the material
transparent.
\li Select the \uicontrol Refraction check box to specify that the
material is \l{Using Highlights and Reflections}{reflective}.
\li Select the \uicontrol {Always dirty} check box to determine that
the material needs to be refreshed every time it is used.
\li In the \uicontrol {Shader Info} field, select the shader info
type to use.
\li In the \uicontrol Passes field, select the pass components for
the effect.
\li In the \uicontrol Material group, select the
\l{Using Highlights and Reflections}{light probe},
\l{Simulating Geometry Displacement}{displacement map and amount},
and \l{Culling Faces}{culling mode} to use.
\li Select the shader info component in \uicontrol Navigator to specify
values for its properties in \uicontrol Properties.
\image studio-qtquick-3d-shader-info.png "Shader Info properties"
\li Select the pass component in \uicontrol Navigator to specify values
for its properties in \uicontrol Properties.
\image studio-qtquick-3d-pass.png "Pass properties"
\li To execute commands during the pass, drag and drop the following
command types from \uicontrol Library to the custom material in
\uicontrol Navigator: \uicontrol Blending, \uicontrol {Buffer Blit},
\uicontrol {Buffer Input}, \uicontrol {Cull Mode},
\uicontrol {Depth Input}, \uicontrol {Render State}, and
\uicontrol {Set Uniform Value}. Then select the commands in the
\uicontrol Commands field.
\li To allocate a buffer for the pass, drag and drop a \uicontrol Buffer
type to the custom material. Then select the buffer in the
\uicontrol Buffer field.
\li Select the shader components in \uicontrol Navigator to set the
paths to the shader files in the \uicontrol Source field in
\uicontrol Properties.
\image studio-qtquick-3d-shader-properties.png "Shader properties"
\endlist
*/

View File

@@ -0,0 +1,190 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Design Studio.
**
** $QT_BEGIN_LICENSE:FDL$
** 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.
** $QT_END_LICENSE$
**
****************************************************************************/
/*!
\page studio-3d-custom-shaders.html
\previouspage studio-3d-effects.html
\nextpage studio-3d-custom-effects-materials.html
\title Using Custom Shaders
You can use the Qt Quick 3D shader utilities and commands to create your own
effects and materials.
For more information on using the shaders, see
\l {Creating Custom Effects and Materials}.
See the following tables for available shader utilities and commands.
\section1 Available Custom Shader Utilities
\table
\header
\li Custom Shader
\li Description
\row
\li \l Buffer
\li A buffer to be used for a pass of a Custom Material or an Effect.
Specify attributes for the buffer by defining the \uicontrol Name
and \uicontrol Format and \uicontrol {Allocation Flags} properties.
The \uicontrol Filter property specifies the filter operation when a
render pass is reading the buffer that differs in size in comparison
to the current output buffer.
The \uicontrol {Coordinate Operation} property specifies the texture
coordinate operation for coordinates outside [0, 1] range.
You can also specify the \uicontrol {Size Multiplier} of the buffer.
Value of 1.0 creates buffer with the same size while 0.5 creates
buffer with width and height halved.
\row
\li \l {CustomMaterial} {Custom Material}
\li The base component for creating custom materials used to shade
models.
Specify the attributes of the \uicontrol {Custom Material} by
defining the \uicontrol Transparency, \uicontrol Refraction and
\uicontrol {Always Dirty} properties. The \uicontrol Passes property
contains a list of render passes implemented by the material.
The \uicontrol {Shader Info} specifies the shader info of the
material. For more information, see \l {Creating Custom Effects and
Materials}.
\row
\li \l Effect
\li A base component for creating post-processing effects.
The \uicontrol Passes property contains a list of render passes
implemented by the effect. For more information, see
\l {Creating Custom Effects and Materials}.
\row
\li \l Pass
\li A render pass in a Custom Material or an Effect.
The \uicontrol Commands property specifies the list of render
commands of the pass. You can further define a render pass by using
the \uicontrol Buffer and \uicontrol Shaders properties.
\row
\li \l Shader
\li A container component for defining shader code used by Custom
Materials and Effects.
Define the \uicontrol Shader attributes by specifying the
\uicontrol Source and \uicontrol Stage properties.
\row
\li \l {ShaderInfo} {Shader Info}
\li Basic information about custom shader code for Custom Materials.
The \uicontrol Version property specifies the shader code version,
while the \uicontrol Type property defines the shader code type.
The \uicontrol Key property specifies the options used by the shader
using the combination of shader key values, such as diffuse or
specular lighting, refraction, transparency, displacement,
transmissiveness, glossiness, and alpha cutout.
\row
\li \l {TextureInput} {Texture Input}
\li A texture channel for a Custom Material or an Effect.
The \uicontrol Texture property specifies the texture to input, while
the \uicontrol Enabled determines whether the texture is enabled.
\endtable
\section1 Available Custom Shader Commands
\table
\header
\li Command
\li Description
\row
\li \l Blending
\li A pass command that specifies the source blending function.
Use the \uicontrol Source and \uicontrol Destination to further
define the function.
\row
\li \l {BufferBlit} {Buffer Blit}
\li A copy operation between two buffers in a pass of a Custom Material
or an Effect.
Define the source and the destination buffer of the copy-operation
by using the \uicontrol Source and \uicontrol Destination
properties.
\row
\li \l {BufferInput} {Buffer Input}
\li An input buffer to be used for a pass of a Custom Material or an
Effect.
The \uicontrol Buffer property specifies the buffer used for the
parameter. The \uicontrol Parameter specifies the name of the input
parameter in the shader.
\row
\li \l {CullMode} {Cull Mode}
\li A culling mode for a render pass.
The \uicontrol Mode specifies the culling mode in a pass when the
\uicontrol {State} property of the \uicontrol {Render State} is
set to \uicontrol CullFace.
\row
\li \l {DepthInput} {Depth Input}
\li An output texture for the depth buffer.
The \uicontrol Parameter property specifies the name of the texture
the depth buffer will bind to.
\row
\li \l {RenderState} {Render State}
\li The render state to be enabled or disabled in a pass of a Custom
Material or an Effect.
The \uicontrol State property specifies the render state to
enable or disable in a pass.
\row
\li \l {SetUniformValue} {Set Uniform Value}
\li A value to be set during a single pass.
The \uicontrol Target property specifies the name of the uniform
that will have its value changed during the pass, while the
\uicontrol Value specifies the value that will be set on the target
uniform.
\endtable
*/

View File

@@ -28,7 +28,7 @@
/*!
\page studio-3d-effects.html
\previouspage studio-3d-texture.html
\nextpage studio-3d-lights.html
\nextpage studio-3d-custom-shaders.html
\title Applying 3D Effects
@@ -44,6 +44,9 @@
See the following table for available effects and example images.
For more information about creating your own effects, see
\l {Creating Custom Effects and Materials}.
\section1 Available Effects
\table
\header

View File

@@ -27,7 +27,7 @@
/*!
\page studio-3d-lights.html
\previouspage studio-3d-effects.html
\previouspage studio-3d-custom-effects-materials.html
\nextpage studio-3d-camera.html
\title Using Lights

View File

@@ -3,7 +3,7 @@
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Desing Studio.
** This file is part of Qt Design Studio.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
@@ -48,7 +48,7 @@
\list
\li Default material
\li Principled material
\li Custom material
\li \l{Creating Custom Effects and Materials}{Custom material}
\li Texture
\endlist
@@ -56,8 +56,7 @@
material to define how the mesh is shaded. The DefaultMaterial component
is the easiest way to define such a material. The PrincipledMaterial
component specifies the minimum amount of properties. The CustomMaterial
component enables you to access the Qt Quick 3D material library and
to implement your own materials.
component enables you to construct your own materials.
You can use the \l Texture component to apply textures to materials. It
defines an image and how the image is mapped to meshes in a 3D scene. For
@@ -219,30 +218,6 @@
is not rendered. Culling makes rendering objects quicker and more efficient
by reducing the number of polygons to draw.
\section1 Creating Custom Materials
The material uses a Shader component to specify shader source and shader
stage. These are used with the \uicontrol passes property to create the
resulting material. The passes can contain multiple rendering passes and
also other commands.
Normally, only the fragment shader needs to be specified as a value for
the \uicontrol passes property. The material library generates the vertex
shader for the material. The material can also create buffers to store
intermediate rendering results.
The \uicontrol shaderInfo property specifies settings for the shader.
To specify that the material state is always dirty, which indicates that
the material needs to be refreshed every time it is used, select the
\uicontrol alwaysDirty check box.
To specify that the material has refraction, select the
\uicontrol hasRefraction check box.
To specify that the material has transparency, select the
\uicontrol hasTransparency check box.
\section1 Applying Materials to Models
To apply materials to models:

View File

@@ -56,10 +56,19 @@ from dumper import DumperBase, SubItem, Children, TopLevelItem
#######################################################################
qqWatchpointOffset = 10000
_c_str_trans = None
if sys.version_info[0] >= 3:
_c_str_trans = str.maketrans({"\n": "\\n", '"':'\\"', "\\":"\\\\"})
def toCString(s):
if _c_str_trans is not None:
return str(s).translate(_c_str_trans)
else:
return str(s).replace('\\', '\\\\').replace('\n', '\\n').replace('"', '\\"')
def fileNameAsString(file):
return str(file) if file.IsValid() else ''
return toCString(file) if file.IsValid() else ''
def check(exp):
@@ -755,9 +764,9 @@ class Dumper(DumperBase):
self.debugger.GetCommandInterpreter().HandleCommand(command, result)
success = result.Succeeded()
if success:
self.report('output="%s"' % result.GetOutput())
self.report('output="%s"' % toCString(result.GetOutput()))
else:
self.report('error="%s"' % result.GetError())
self.report('error="%s"' % toCString(result.GetError()))
def canonicalTypeName(self, name):
return re.sub('\\bconst\\b', '', name).replace(' ', '')
@@ -921,7 +930,7 @@ class Dumper(DumperBase):
state = 1 if self.target.IsValid() else 0
self.reportResult('success="%s",msg="%s",exe="%s"'
% (state, error, self.executable_), args)
% (state, toCString(error), toCString(self.executable_)), args)
def runEngine(self, args):
""" Set up SBProcess instance """
@@ -1033,16 +1042,16 @@ class Dumper(DumperBase):
def describeError(self, error):
desc = lldb.SBStream()
error.GetDescription(desc)
result = 'success="%s",' % int(error.Success())
result = 'success="%d",' % int(error.Success())
result += 'error={type="%s"' % error.GetType()
if error.GetType():
result += ',status="%s"' % error.GetCString()
result += ',code="%s"' % error.GetError()
result += ',desc="%s"}' % desc.GetData()
result += ',desc="%s"}' % toCString(desc.GetData())
return result
def describeStatus(self, status):
return 'status="%s",' % status
return 'status="%s",' % toCString(status)
def describeLocation(self, frame):
if int(frame.pc) == 0xffffffffffffffff:
@@ -1085,10 +1094,10 @@ class Dumper(DumperBase):
reason = thread.GetStopReason()
result += '{id="%d"' % thread.GetThreadID()
result += ',index="%s"' % i
result += ',details="%s"' % thread.GetQueueName()
result += ',details="%s"' % toCString(thread.GetQueueName())
result += ',stop-reason="%s"' % self.stopReason(thread.GetStopReason())
result += ',state="%s"' % state
result += ',name="%s"' % thread.GetName()
result += ',name="%s"' % toCString(thread.GetName())
result += ',frame={'
frame = thread.GetFrameAtIndex(0)
result += 'pc="0x%x"' % frame.pc
@@ -1126,7 +1135,7 @@ class Dumper(DumperBase):
limit = args.get('stacklimit', -1)
(n, isLimited) = (limit, True) if limit > 0 else (thread.GetNumFrames(), False)
self.currentCallContext = None
result = 'stack={current-thread="%s"' % thread.GetThreadID()
result = 'stack={current-thread="%d"' % thread.GetThreadID()
result += ',frames=['
for i in range(n):
frame = thread.GetFrameAtIndex(i)
@@ -1148,7 +1157,7 @@ class Dumper(DumperBase):
interpreterStack = self.extractInterpreterStack()
for interpreterFrame in interpreterStack.get('frames', []):
function = interpreterFrame.get('function', '')
fileName = interpreterFrame.get('file', '')
fileName = toCString(interpreterFrame.get('file', ''))
language = interpreterFrame.get('language', '')
lineNumber = interpreterFrame.get('line', 0)
context = interpreterFrame.get('context', 0)
@@ -1162,7 +1171,7 @@ class Dumper(DumperBase):
result += ',address="0x%x"' % addr
result += ',function="%s"' % functionName
result += ',line="%d"' % lineNumber
result += ',module="%s"' % module
result += ',module="%s"' % toCString(module)
result += ',file="%s"},' % fileName
result += ']'
result += ',hasmore="%d"' % isLimited
@@ -1202,7 +1211,7 @@ class Dumper(DumperBase):
return self.target.FindFirstGlobalVariable(symbolName)
def warn(self, msg):
self.put('{name="%s",value="",type="",numchild="0"},' % msg)
self.put('{name="%s",value="",type="",numchild="0"},' % toCString(msg))
def fetchVariables(self, args):
(ok, res) = self.tryFetchInterpreterVariables(args)
@@ -1314,15 +1323,15 @@ class Dumper(DumperBase):
interp.HandleCommand("register write %s %s" % (name, value), result)
success = result.Succeeded()
if success:
self.reportResult('output="%s"' % result.GetOutput(), args)
self.reportResult('output="%s"' % toCString(result.GetOutput()), args)
return
# Try again with register write xmm0 "{0x00 ... 0x02}" syntax:
vec = ' '.join(["0x" + value[i:i + 2] for i in range(2, len(value), 2)])
success = interp.HandleCommand('register write %s "{%s}"' % (name, vec), result)
if success:
self.reportResult('output="%s"' % result.GetOutput(), args)
self.reportResult('output="%s"' % toCString(result.GetOutput()), args)
else:
self.reportResult('error="%s"' % result.GetError(), args)
self.reportResult('error="%s"' % toCString(result.GetError()), args)
def report(self, stuff):
with self.outputLock:
@@ -1386,14 +1395,16 @@ class Dumper(DumperBase):
skipEventReporting = eventType in (
lldb.SBProcess.eBroadcastBitSTDOUT, lldb.SBProcess.eBroadcastBitSTDERR)
self.report('event={type="%s",data="%s",msg="%s",flavor="%s",state="%s",bp="%s"}'
% (eventType, out.GetData(), msg, flavor, self.stateName(state), bp))
% (eventType, toCString(out.GetData()),
toCString(msg), flavor, self.stateName(state), bp))
if state == lldb.eStateExited:
self.eventState = state
if not self.isShuttingDown_:
self.reportState("inferiorexited")
self.report('exited={status="%s",desc="%s"}'
% (self.process.GetExitStatus(), self.process.GetExitDescription()))
self.report('exited={status="%d",desc="%s"}'
% (self.process.GetExitStatus(),
toCString(self.process.GetExitDescription())))
elif state != self.eventState and not skipEventReporting:
self.eventState = state
if state == lldb.eStateStopped:
@@ -1457,17 +1468,17 @@ class Dumper(DumperBase):
result = 'lldbid="%s"' % (qqWatchpointOffset + bp.GetID())
else:
result = 'lldbid="%s"' % bp.GetID()
result += ',valid="%s"' % (1 if bp.IsValid() else 0)
result += ',hitcount="%s"' % bp.GetHitCount()
result += ',valid="%d"' % (1 if bp.IsValid() else 0)
result += ',hitcount="%d"' % bp.GetHitCount()
if bp.IsValid():
if isinstance(bp, lldb.SBBreakpoint):
result += ',threadid="%s"' % bp.GetThreadID()
result += ',oneshot="%s"' % (1 if bp.IsOneShot() else 0)
result += ',threadid="%d"' % bp.GetThreadID()
result += ',oneshot="%d"' % (1 if bp.IsOneShot() else 0)
cond = bp.GetCondition()
result += ',condition="%s"' % self.hexencode("" if cond is None else cond)
result += ',enabled="%s"' % (1 if bp.IsEnabled() else 0)
result += ',valid="%s"' % (1 if bp.IsValid() else 0)
result += ',ignorecount="%s"' % bp.GetIgnoreCount()
result += ',enabled="%d"' % (1 if bp.IsEnabled() else 0)
result += ',valid="%d"' % (1 if bp.IsValid() else 0)
result += ',ignorecount="%d"' % bp.GetIgnoreCount()
if bp.IsValid() and isinstance(bp, lldb.SBBreakpoint):
result += ',locations=['
lineEntry = None
@@ -1475,19 +1486,19 @@ class Dumper(DumperBase):
loc = bp.GetLocationAtIndex(i)
addr = loc.GetAddress()
lineEntry = addr.GetLineEntry()
result += '{locid="%s"' % loc.GetID()
result += '{locid="%d"' % loc.GetID()
result += ',function="%s"' % addr.GetFunction().GetName()
result += ',enabled="%s"' % (1 if loc.IsEnabled() else 0)
result += ',resolved="%s"' % (1 if loc.IsResolved() else 0)
result += ',valid="%s"' % (1 if loc.IsValid() else 0)
result += ',ignorecount="%s"' % loc.GetIgnoreCount()
result += ',file="%s"' % lineEntry.GetFileSpec()
result += ',line="%s"' % lineEntry.GetLine()
result += ',enabled="%d"' % (1 if loc.IsEnabled() else 0)
result += ',resolved="%d"' % (1 if loc.IsResolved() else 0)
result += ',valid="%d"' % (1 if loc.IsValid() else 0)
result += ',ignorecount="%d"' % loc.GetIgnoreCount()
result += ',file="%s"' % toCString(lineEntry.GetFileSpec())
result += ',line="%d"' % lineEntry.GetLine()
result += ',addr="%s"},' % addr.GetFileAddress()
result += ']'
if lineEntry is not None:
result += ',file="%s"' % lineEntry.GetFileSpec()
result += ',line="%s"' % lineEntry.GetLine()
result += ',file="%s"' % toCString(lineEntry.GetFileSpec())
result += ',line="%d"' % lineEntry.GetLine()
return result
def createBreakpointAtMain(self):
@@ -1590,7 +1601,7 @@ class Dumper(DumperBase):
loc.SetEnabled(bool(args['enabled']))
enabled = loc.IsEnabled()
res = True
self.reportResult('success="%s",enabled="%s",locid="%s"'
self.reportResult('success="%d",enabled="%d",locid="%d"'
% (int(res), int(enabled), locId), args)
def removeBreakpoint(self, args):
@@ -1598,21 +1609,21 @@ class Dumper(DumperBase):
if lldbId > qqWatchpointOffset:
res = self.target.DeleteWatchpoint(lldbId - qqWatchpointOffset)
res = self.target.BreakpointDelete(lldbId)
self.reportResult('success="%s"' % int(res), args)
self.reportResult('success="%d"' % int(res), args)
def fetchModules(self, args):
result = 'modules=['
for i in range(self.target.GetNumModules()):
module = self.target.GetModuleAtIndex(i)
result += '{file="%s"' % module.file.fullpath
result += ',name="%s"' % module.file.basename
result += ',addrsize="%s"' % module.addr_size
result += '{file="%s"' % toCString(module.file.fullpath)
result += ',name="%s"' % toCString(module.file.basename)
result += ',addrsize="%d"' % module.addr_size
result += ',triple="%s"' % module.triple
#result += ',sections={'
#for section in module.sections:
# result += '[name="%s"' % section.name
# result += ',addr="%s"' % section.addr
# result += ',size="%s"],' % section.size
# result += ',size="%d"],' % section.size
#result += '}'
result += '},'
result += ']'
@@ -1636,7 +1647,7 @@ class Dumper(DumperBase):
result += ',name="%s"' % symbol.GetName()
result += ',address="0x%x"' % startAddress
result += ',demangled="%s"' % symbol.GetMangledName()
result += ',size="%s"' % (endAddress - startAddress)
result += ',size="%d"' % (endAddress - startAddress)
result += '},'
result += ']}'
self.reportResult(result, args)
@@ -1726,7 +1737,8 @@ class Dumper(DumperBase):
result = lldb.SBCommandReturnObject()
self.debugger.GetCommandInterpreter().HandleCommand('break list', result)
self.report('success="%d",output="%s",error="%s"'
% (result.Succeeded(), result.GetOutput(), result.GetError()))
% (result.Succeeded(), toCString(result.GetOutput()),
toCString(result.GetError())))
def activateFrame(self, args):
self.reportToken(args)
@@ -1751,8 +1763,8 @@ class Dumper(DumperBase):
command = args['command']
self.debugger.GetCommandInterpreter().HandleCommand(command, result)
success = result.Succeeded()
output = result.GetOutput()
error = str(result.GetError())
output = toCString(result.GetOutput())
error = toCString(str(result.GetError()))
self.report('success="%d",output="%s",error="%s"' % (success, output, error))
def executeRoundtrip(self, args):
@@ -1808,8 +1820,8 @@ class Dumper(DumperBase):
# with non-existent directories appear.
self.warn('FILE: %s ERROR: %s' % (fileName, error))
source = ''
result += '{line="%s"' % lineNumber
result += ',file="%s"' % fileName
result += '{line="%d"' % lineNumber
result += ',file="%s"' % toCString(fileName)
if 0 < lineNumber and lineNumber <= len(source):
result += ',hexdata="%s"' % self.hexencode(source[lineNumber - 1])
result += ',hunk="%s"}' % hunk

View File

@@ -1425,9 +1425,9 @@ Module {
Property { name: "highlight"; type: "QDeclarativeComponent"; isPointer: true }
Property { name: "highlightItem"; type: "QDeclarativeItem"; isReadonly: true; isPointer: true }
Property { name: "highlightFollowsCurrentItem"; type: "bool" }
Property { name: "highlightMoveSpeed"; type: "qreal" }
Property { name: "highlightMoveVelocity"; type: "qreal" }
Property { name: "highlightMoveDuration"; type: "int" }
Property { name: "highlightResizeSpeed"; type: "qreal" }
Property { name: "highlightResizeVelocity"; type: "qreal" }
Property { name: "highlightResizeDuration"; type: "int" }
Property { name: "preferredHighlightBegin"; type: "qreal" }
Property { name: "preferredHighlightEnd"; type: "qreal" }
@@ -1448,9 +1448,9 @@ Module {
Signal { name: "layoutDirectionChanged"; revision: 1 }
Signal { name: "currentIndexChanged" }
Signal { name: "currentSectionChanged" }
Signal { name: "highlightMoveSpeedChanged" }
Signal { name: "highlightMoveVelocityChanged" }
Signal { name: "highlightMoveDurationChanged" }
Signal { name: "highlightResizeSpeedChanged" }
Signal { name: "highlightResizeVelocityChanged" }
Signal { name: "highlightResizeDurationChanged" }
Signal { name: "highlightChanged" }
Signal { name: "highlightItemChanged" }

View File

@@ -26,13 +26,47 @@
#pragma once
#include <QMetaType>
#include <QVariant>
#include "imagecontainer.h"
#include <utils/smallstringio.h>
#include <vector>
namespace QmlDesigner {
template<typename Type>
QDataStream &operator<<(QDataStream &out, const std::vector<Type> &vector)
{
out << quint64(vector.size());
for (auto &&entry : vector)
out << entry;
return out;
}
template<typename Type>
QDataStream &operator>>(QDataStream &in, std::vector<Type> &vector)
{
vector.clear();
quint64 size;
in >> size;
vector.reserve(size);
for (quint64 i = 0; i < size; ++i) {
Type entry;
in >> entry;
vector.push_back(std::move(entry));
}
return in;
}
class CapturedDataCommand
{
public:

View File

@@ -231,9 +231,12 @@ ServerNodeInstance ServerNodeInstance::create(NodeInstanceServer *nodeInstanceSe
} else if (!instanceContainer.componentPath().isEmpty()) {
object = Internal::ObjectNodeInstance::createComponent(instanceContainer.componentPath(), nodeInstanceServer->context());
if (object == nullptr) {
const QString errors = getErrorString(nodeInstanceServer->engine(), instanceContainer.componentPath());
const QString message = QString("Component with path %1 could not be created.\n\n").arg(instanceContainer.componentPath());
nodeInstanceServer->sendDebugOutput(DebugOutputCommand::ErrorType, message + errors, instanceContainer.instanceId());
object = Internal::ObjectNodeInstance::createPrimitive(QString::fromUtf8(instanceContainer.type()), instanceContainer.majorNumber(), instanceContainer.minorNumber(), nodeInstanceServer->context());
if (object == nullptr) {
const QString errors = getErrorString(nodeInstanceServer->engine(), instanceContainer.componentPath());
const QString message = QString("Component with path %1 could not be created.\n\n").arg(instanceContainer.componentPath());
nodeInstanceServer->sendDebugOutput(DebugOutputCommand::ErrorType, message + errors, instanceContainer.instanceId());
}
}
} else {
object = Internal::ObjectNodeInstance::createPrimitive(QString::fromUtf8(instanceContainer.type()), instanceContainer.majorNumber(), instanceContainer.minorNumber(), nodeInstanceServer->context());

View File

@@ -197,22 +197,6 @@ Column {
}
}
Label {
text: qsTr("Move speed")
tooltip: qsTr("Move animation speed of the highlight delegate.")
}
SectionLayout {
SpinBox {
backendValue: backendValues.highlightMoveSpeed
minimumValue: 0
maximumValue: 1000
decimals: 0
}
ExpandingSpacer {
}
}
Label {
text: qsTr("Preferred begin")
tooltip: qsTr("Preferred highlight begin - must be smaller than Preferred end.")

View File

@@ -70,12 +70,14 @@ Column {
Label {
text: qsTr("Source size")
disabledState: !backendValues.sourceSize.isAvailable
}
SecondColumnLayout {
Label {
text: "W"
width: 12
disabledStateSoft: !backendValues.sourceSize_width.isAvailable
}
SpinBox {
@@ -83,6 +85,7 @@ Column {
minimumValue: 0
maximumValue: 8192
decimals: 0
enabled: backendValue.isAvailable
}
Item {
@@ -93,6 +96,7 @@ Column {
Label {
text: "H"
width: 12
disabledStateSoft: !backendValues.sourceSize_height.isAvailable
}
SpinBox {
@@ -100,6 +104,7 @@ Column {
minimumValue: 0
maximumValue: 8192
decimals: 0
enabled: backendValue.isAvailable
}
ExpandingSpacer {

View File

@@ -46,6 +46,7 @@ Column {
Label {
text: qsTr("Cache")
tooltip: qsTr("Cache buffer")
disabledState: !backendValues.cacheBuffer.isAvailable
}
SectionLayout {
@@ -54,6 +55,7 @@ Column {
minimumValue: 0
maximumValue: 1000
decimals: 0
enabled: backendValue.isAvailable
}
ExpandingSpacer {
@@ -63,6 +65,7 @@ Column {
Label {
text: qsTr("Navigation wraps")
tooltip: qsTr("Whether the grid wraps key navigation.")
disabledState: !backendValues.keyNavigationWraps.isAvailable
}
SectionLayout {
@@ -70,6 +73,7 @@ Column {
Layout.fillWidth: true
backendValue: backendValues.keyNavigationWraps
text: backendValues.keyNavigationWraps.valueToString
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -93,6 +97,7 @@ Column {
Label {
text: qsTr("Layout direction")
disabledState: !backendValues.layoutDirection.isAvailable
}
SecondColumnLayout {
@@ -101,6 +106,7 @@ Column {
model: ["LeftToRight", "RightToLeft"]
backendValue: backendValues.layoutDirection
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -109,6 +115,7 @@ Column {
Label {
text: qsTr("Snap mode")
tooltip: qsTr("Determines how the view scrolling will settle following a drag or flick.")
disabledState: !backendValues.snapMode.isAvailable
}
SecondColumnLayout {
@@ -117,6 +124,7 @@ Column {
model: ["NoSnap", "SnapToItem", "SnapOneItem"]
backendValue: backendValues.snapMode
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -151,6 +159,7 @@ Column {
Label {
text: qsTr("Range")
tooltip: qsTr("Highlight range")
disabledState: !backendValues.highlightRangeMode.isAvailable
}
SecondColumnLayout {
@@ -159,6 +168,7 @@ Column {
model: ["NoHighlightRange", "ApplyRange", "StrictlyEnforceRange"]
backendValue: backendValues.highlightRangeMode
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -168,30 +178,34 @@ Column {
Label {
text: qsTr("Move duration")
tooltip: qsTr("Move animation duration of the highlight delegate.")
disabledState: !backendValues.highlightMoveDuration.isAvailable
}
SectionLayout {
SpinBox {
backendValue: backendValues.highlightMoveDuration
minimumValue: 0
minimumValue: -1
maximumValue: 1000
decimals: 0
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
}
Label {
text: qsTr("Move speed")
tooltip: qsTr("Move animation speed of the highlight delegate.")
text: qsTr("Move velocity")
tooltip: qsTr("Move animation velocity of the highlight delegate.")
disabledState: !backendValues.highlightMoveVelocity.isAvailable
}
SectionLayout {
SpinBox {
backendValue: backendValues.highlightMoveSpeed
minimumValue: 0
backendValue: backendValues.highlightMoveVelocity
minimumValue: -1
maximumValue: 1000
decimals: 0
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -200,14 +214,34 @@ Column {
Label {
text: qsTr("Resize duration")
tooltip: qsTr("Resizes animation duration of the highlight delegate.")
disabledState: !backendValues.highlightResizeDuration.isAvailable
}
SectionLayout {
SpinBox {
backendValue: backendValues.highlightResizeDuration
minimumValue: 0
minimumValue: -1
maximumValue: 1000
decimals: 0
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
}
Label {
text: qsTr("Resize velocity")
tooltip: qsTr("Resize animation velocity of the highlight delegate.")
disabledState: !backendValues.highlightResizeVelocity.isAvailable
}
SectionLayout {
SpinBox {
backendValue: backendValues.highlightResizeVelocity
minimumValue: -1
maximumValue: 1000
decimals: 0
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -216,6 +250,7 @@ Column {
Label {
text: qsTr("Preferred begin")
tooltip: qsTr("Preferred highlight begin - must be smaller than Preferred end.")
disabledState: !backendValues.preferredHighlightBegin.isAvailable
}
SectionLayout {
@@ -224,6 +259,7 @@ Column {
minimumValue: 0
maximumValue: 1000
decimals: 0
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -232,6 +268,7 @@ Column {
Label {
text: qsTr("Preferred end")
tooltip: qsTr("Preferred highlight end - must be larger than Preferred begin.")
disabledState: !backendValues.preferredHighlightEnd.isAvailable
}
SectionLayout {
@@ -240,6 +277,7 @@ Column {
minimumValue: 0
maximumValue: 1000
decimals: 0
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -248,6 +286,7 @@ Column {
Label {
text: qsTr("Follows current")
tooltip: qsTr("Whether the highlight is managed by the view.")
disabledState: !backendValues.highlightFollowsCurrentItem.isAvailable
}
SectionLayout {
@@ -255,6 +294,7 @@ Column {
Layout.fillWidth: true
backendValue: backendValues.highlightFollowsCurrentItem
text: backendValues.highlightFollowsCurrentItem.valueToString
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}

View File

@@ -40,6 +40,7 @@ Column {
Label {
text: qsTr("Enabled")
tooltip: qsTr("Accepts mouse events.")
disabledState: !backendValues.enabled.isAvailable
}
SecondColumnLayout {
@@ -47,6 +48,7 @@ Column {
Layout.fillWidth: true
backendValue: backendValues.enabled
text: backendValues.enabled.valueToString
enabled: backendValue.isAvailable
}
ExpandingSpacer {
@@ -56,6 +58,7 @@ Column {
Label {
text: qsTr("Hover enabled")
tooltip: qsTr("Handles hover events.")
disabledState: !backendValues.hoverEnabled.isAvailable
}
SecondColumnLayout {
@@ -63,6 +66,7 @@ Column {
Layout.fillWidth: true
backendValue: backendValues.hoverEnabled
text: backendValues.hoverEnabled.valueToString
enabled: backendValue.isAvailable
}
ExpandingSpacer {
@@ -72,6 +76,7 @@ Column {
Label {
text: qsTr("Accepted buttons")
tooltip: qsTr("Mouse buttons that the mouse area reacts to.")
disabledState: !backendValues.acceptedButtons.isAvailable
}
SecondColumnLayout {
@@ -80,6 +85,7 @@ Column {
model: ["LeftButton", "RightButton", "MiddleButton", "BackButton", "ForwardButton", "AllButtons"]
Layout.fillWidth: true
scope: "Qt"
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -104,6 +110,7 @@ Column {
Label {
text: qsTr("Scroll gesture enabled")
tooltip: qsTr("Responds to scroll gestures from non-mouse devices.")
disabledState: !backendValues.scrollGestureEnabled.isAvailable
}
SecondColumnLayout {
@@ -111,6 +118,7 @@ Column {
Layout.fillWidth: true
backendValue: backendValues.scrollGestureEnabled
text: backendValues.scrollGestureEnabled.valueToString
enabled: backendValue.isAvailable
}
ExpandingSpacer {
@@ -120,6 +128,7 @@ Column {
Label {
text: qsTr("Cursor shape")
tooltip: qsTr("Cursor shape for this mouse area.")
disabledState: !backendValues.cursorShape.isAvailable
}
SecondColumnLayout {
@@ -133,6 +142,7 @@ Column {
"DragMoveCursor", "DragLinkCursor"]
Layout.fillWidth: true
scope: "Qt"
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -141,6 +151,7 @@ Column {
Label {
text: qsTr("Prevent stealing")
tooltip: qsTr("Stops mouse events from being stolen from this mouse area.")
disabledState: !backendValues.preventStealing.isAvailable
}
SecondColumnLayout {
@@ -148,6 +159,7 @@ Column {
Layout.fillWidth: true
backendValue: backendValues.preventStealing
text: backendValues.preventStealing.valueToString
enabled: backendValue.isAvailable
}
ExpandingSpacer {
@@ -157,6 +169,7 @@ Column {
Label {
text: qsTr("Propagate composed events")
tooltip: qsTr("Automatically propagates composed mouse events to other mouse areas.")
disabledState: !backendValues.propagateComposedEvents.isAvailable
}
SecondColumnLayout {
@@ -164,6 +177,7 @@ Column {
Layout.fillWidth: true
backendValue: backendValues.propagateComposedEvents
text: backendValues.propagateComposedEvents.valueToString
enabled: backendValue.isAvailable
}
ExpandingSpacer {
@@ -176,6 +190,7 @@ Column {
anchors.left: parent.left
anchors.right: parent.right
caption: qsTr("Drag")
visible: backendValues.drag_target.isAvailable
SectionLayout {
Label {

View File

@@ -39,6 +39,7 @@ Column {
SectionLayout {
Label {
text: qsTr("Layout direction")
disabledState: !backendValues.layoutDirection.isAvailable
}
SecondColumnLayout {
@@ -47,6 +48,7 @@ Column {
backendValue: backendValues.layoutDirection
Layout.fillWidth: true
scope: "Qt"
enabled: backendValue.isAvailable
}
}

View File

@@ -56,6 +56,7 @@ Column {
anchors.left: parent.left
anchors.right: parent.right
caption: qsTr("Style Color")
visible: backendValues.styleColor.isAvailable
ColorEditor {
caption: qsTr("Style Color")

View File

@@ -42,6 +42,7 @@ Section {
Label {
text: qsTr("Flick direction")
disabledState: !backendValues.flickableDirection.isAvailable
}
SecondColumnLayout {
@@ -50,6 +51,7 @@ Section {
model: ["AutoFlickDirection", "AutoFlickIfNeeded", "HorizontalFlick", "VerticalFlick", "HorizontalAndVerticalFlick"]
Layout.fillWidth: true
scope: "Flickable"
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -58,6 +60,7 @@ Section {
Label {
text: qsTr("Behavior")
tooltip: qsTr("Whether the surface may be dragged beyond the Flickable's boundaries, or overshoot the Flickable's boundaries when flicked.")
disabledState: !backendValues.boundsBehavior.isAvailable
}
SecondColumnLayout {
@@ -66,6 +69,7 @@ Section {
model: ["StopAtBounds", "DragOverBounds", "OvershootBounds", "DragAndOvershootBounds"]
Layout.fillWidth: true
scope: "Flickable"
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -75,6 +79,7 @@ Section {
Label {
text: qsTr("Movement")
tooltip: qsTr("Whether the Flickable will give a feeling that the edges of the view are soft, rather than a hard physical boundary.")
disabledState: !backendValues.boundsMovement.isAvailable
}
SecondColumnLayout {
@@ -83,6 +88,7 @@ Section {
model: ["FollowBoundsBehavior", "StopAtBounds"]
Layout.fillWidth: true
scope: "Flickable"
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -122,6 +128,7 @@ Section {
Label {
text: qsTr("Deceleration")
tooltip: qsTr("Flick deceleration.")
disabledState: !backendValues.flickDeceleration.isAvailable
}
SecondColumnLayout {
@@ -130,6 +137,7 @@ Section {
minimumValue: 0
maximumValue: 8000
decimals: 0
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -138,6 +146,7 @@ Section {
Label {
text: qsTr("Press delay")
tooltip: qsTr("Time to delay delivering a press to children of the Flickable in milliseconds.")
disabledState: !backendValues.pressDelay.isAvailable
}
SecondColumnLayout {
@@ -146,6 +155,7 @@ Section {
minimumValue: 0
maximumValue: 2000
decimals: 0
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -154,6 +164,7 @@ Section {
Label {
text: qsTr("Pixel aligned")
tooltip: qsTr("Sets the alignment of contentX and contentY to pixels (true) or subpixels (false).")
disabledState: !backendValues.pixelAligned.isAvailable
}
SecondColumnLayout {
@@ -161,6 +172,7 @@ Section {
Layout.fillWidth: true
backendValue: backendValues.pixelAligned
text: backendValues.pixelAligned.valueToString
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -171,6 +183,7 @@ Section {
tooltip: qsTr("If set to true, then when the mouse or touchpoint moves far enough to begin dragging\n"
+ "the content, the content will jump, such that the content pixel which was under the\n"
+ "cursor or touchpoint when pressed remains under that point.")
disabledState: !backendValues.synchronousDrag.isAvailable
}
SecondColumnLayout {
@@ -178,6 +191,7 @@ Section {
Layout.fillWidth: true
backendValue: backendValues.synchronousDrag
text: backendValues.synchronousDrag.valueToString
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -265,12 +279,15 @@ Section {
Label {
text: qsTr("Origin")
disabledState: (!backendValues.originX.isAvailable
&& !backendValues.originY.isAvailable)
}
SecondColumnLayout {
Label {
text: "X"
width: root.labelWidth
disabledStateSoft: !backendValues.originX.isAvailable
}
SpinBox {
@@ -279,6 +296,7 @@ Section {
maximumValue: 8000
implicitWidth: root.spinBoxWidth
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
Item {
@@ -289,6 +307,7 @@ Section {
Label {
text: "Y"
width: root.labelWidth
disabledStateSoft: !backendValues.originY.isAvailable
}
SpinBox {
@@ -297,6 +316,7 @@ Section {
maximumValue: 8000
implicitWidth: root.spinBoxWidth
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -304,6 +324,10 @@ Section {
Label {
text: qsTr("Margins")
disabledState: (!backendValues.topMargin.isAvailable
&& !backendValues.bottomMargin.isAvailable
&& !backendValues.leftMargin.isAvailable
&& !backendValues.rightMargin.isAvailable)
}
SecondColumnLayout {
@@ -312,6 +336,7 @@ Section {
Label {
text: "Top"
width: root.labelWidth
disabledStateSoft: !backendValues.topMargin.isAvailable
}
SpinBox {
@@ -321,6 +346,7 @@ Section {
decimals: 0
implicitWidth: root.spinBoxWidth
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
Item {
@@ -331,6 +357,7 @@ Section {
Label {
text: "Bottom"
width: root.labelWidth
disabledStateSoft: !backendValues.bottomMargin.isAvailable
}
SpinBox {
@@ -340,6 +367,7 @@ Section {
decimals: 0
implicitWidth: root.spinBoxWidth
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}
@@ -355,6 +383,7 @@ Section {
Label {
text: "Left"
width: root.labelWidth
disabledStateSoft: !backendValues.leftMargin.isAvailable
}
SpinBox {
@@ -364,6 +393,7 @@ Section {
decimals: 0
implicitWidth: root.spinBoxWidth
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
Item {
@@ -374,6 +404,7 @@ Section {
Label {
text: "Right"
width: root.labelWidth
disabledStateSoft: !backendValues.rightMargin.isAvailable
}
SpinBox {
@@ -383,6 +414,7 @@ Section {
decimals: 0
implicitWidth: root.spinBoxWidth
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
ExpandingSpacer {
}

View File

@@ -153,12 +153,13 @@ Section {
italic: fontSection.italicStyle
underline: fontSection.underlineStyle
strikeout: fontSection.strikeoutStyle
enabled: !styleComboBox.styleSet
enabled: !styleNameComboBox.styleSet
}
Label {
text: qsTr("Font capitalization")
toolTip: qsTr("Capitalization for the text.")
disabledState: !getBackendValue("capitalization").isAvailable
}
ComboBox {
@@ -166,6 +167,7 @@ Section {
backendValue: getBackendValue("capitalization")
model: ["MixedCase", "AllUppercase", "AllLowercase", "SmallCaps", "Capitalize"]
scope: "Font"
enabled: backendValue.isAvailable
}
Label {
@@ -178,38 +180,45 @@ Section {
backendValue: getBackendValue("weight")
model: ["Normal", "Light", "ExtraLight", "Thin", "Medium", "DemiBold", "Bold", "ExtraBold", "Black"]
scope: "Font"
enabled: !styleComboBox.styleSet
enabled: !styleNameComboBox.styleSet
}
Label {
text: qsTr("Style name")
toolTip: qsTr("Font's style.")
disabledState: !styleNameComboBox.enabled
}
ComboBox {
id: styleComboBox
id: styleNameComboBox
property bool styleSet: backendValue.isInModel
Layout.fillWidth: true
backendValue: getBackendValue("styleName")
model: styleNamesForFamily(fontComboBox.familyName)
valueType: ComboBox.String
enabled: backendValue.isAvailable
}
Label {
visible: showStyle
text: qsTr("Style")
disabledState: !styleComboBox.enabled
}
ComboBox {
id: styleComboBox
visible: showStyle
Layout.fillWidth: true
backendValue: (backendValues.style === undefined) ? dummyBackendValue : backendValues.style
model: ["Normal", "Outline", "Raised", "Sunken"]
scope: "Text"
enabled: backendValue.isAvailable
}
Label {
text: qsTr("Spacing")
disabledState: (!getBackendValue("wordSpacing").isAvailable &&
!getBackendValue("letterSpacing").isAvailable)
}
SecondColumnLayout {
@@ -222,18 +231,19 @@ Section {
Layout.fillWidth: true
Layout.minimumWidth: 60
stepSize: 0.1
enabled: backendValue.isAvailable
}
Label {
text: qsTr("Word")
tooltip: qsTr("Word spacing for the font.")
width: 42
disabledStateSoft: !getBackendValue("wordSpacing").isAvailable
}
Item {
width: 4
height: 4
}
SpinBox {
maximumValue: 500
minimumValue: -500
@@ -242,17 +252,21 @@ Section {
Layout.fillWidth: true
Layout.minimumWidth: 60
stepSize: 0.1
enabled: backendValue.isAvailable
}
Label {
text: qsTr("Letter")
tooltip: qsTr("Letter spacing for the font.")
width: 42
disabledStateSoft: !getBackendValue("letterSpacing").isAvailable
}
}
Label {
visible: minorQtQuickVersion > 9
text: qsTr("Performance")
disabledState: (!getBackendValue("kerning").isAvailable &&
!getBackendValue("preferShaping").isAvailable)
}
SecondColumnLayout {
@@ -264,6 +278,7 @@ Section {
backendValue: getBackendValue("kerning")
tooltip: qsTr("Enables or disables the kerning OpenType feature when shaping the text. Disabling this may " +
"improve performance when creating or changing the text, at the expense of some cosmetic features.")
enabled: backendValue.isAvailable
}
CheckBox {
@@ -273,12 +288,14 @@ Section {
tooltip: qsTr("Sometimes, a font will apply complex rules to a set of characters in order to display them correctly.\n" +
"In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, whereas in " +
"Latin script,\n it is merely a cosmetic feature. Setting the preferShaping property to false will disable all such features\nwhen they are not required, which will improve performance in most cases.")
enabled: backendValue.isAvailable
}
}
Label {
text: qsTr("Hinting preference")
toolTip: qsTr("Preferred hinting on the text.")
disabledState: !getBackendValue("hintingPreference").isAvailable
}
ComboBox {
@@ -286,6 +303,7 @@ Section {
backendValue: getBackendValue("hintingPreference")
model: ["PreferDefaultHinting", "PreferNoHinting", "PreferVerticalHinting", "PreferFullHinting"]
scope: "Font"
enabled: backendValue.isAvailable
}
}
}

View File

@@ -37,6 +37,7 @@ ButtonRow {
BoolButtonRowButton {
buttonIcon: StudioTheme.Constants.fontStyleBold
backendValue: bold
enabled: backendValue.isAvailable
}
Item {
width: 4
@@ -45,6 +46,7 @@ ButtonRow {
BoolButtonRowButton {
buttonIcon: StudioTheme.Constants.fontStyleItalic
backendValue: italic
enabled: backendValue.isAvailable
}
Item {
width: 4
@@ -53,6 +55,7 @@ ButtonRow {
BoolButtonRowButton {
buttonIcon: StudioTheme.Constants.fontStyleUnderline
backendValue: underline
enabled: backendValue.isAvailable
}
Item {
width: 4
@@ -61,5 +64,6 @@ ButtonRow {
BoolButtonRowButton {
buttonIcon: StudioTheme.Constants.fontStyleStrikethrough
backendValue: strikeout
enabled: backendValue.isAvailable
}
}

View File

@@ -37,7 +37,9 @@ Label {
property alias toolTip: toolTipArea.tooltip
width: Math.max(Math.min(240, parent.width - 280), 50)
color: label.disabledState ? StudioTheme.Values.themeDisabledTextColor : StudioTheme.Values.themeTextColor
color: ((label.disabledState || label.disabledStateSoft)
? StudioTheme.Values.themeDisabledTextColor
: StudioTheme.Values.themeTextColor)
elide: Text.ElideRight
@@ -50,7 +52,9 @@ Label {
leftPadding: label.disabledState ? 10 : 0
rightPadding: label.disabledState ? 10 : 0
//Label can be disabled fully (with [] and padding), or in a soft way: only with tooltip and color change.
property bool disabledState: false
property bool disabledStateSoft: false
Text {
text: "["
@@ -68,6 +72,8 @@ Label {
ToolTipArea {
id: toolTipArea
anchors.fill: parent
tooltip: label.disabledState ? qsTr("This property is not available in this configuration.") : label.text
tooltip: ((label.disabledState || label.disabledStateSoft)
? qsTr("This property is not available in this configuration.")
: label.text)
}
}

View File

@@ -36,12 +36,14 @@ Section {
SectionLayout {
Label {
text: qsTr("Vertical")
disabledState: (!backendValues.topPadding.isAvailable && !backendValues.bottomPadding.isAvailable)
}
SecondColumnLayout {
Label {
text: qsTr("Top")
tooltip: qsTr("Padding between the content and the top edge of the item.")
width: 42
disabledStateSoft: !backendValues.topPadding.isAvailable
}
SpinBox {
maximumValue: 10000
@@ -50,6 +52,7 @@ Section {
decimals: 0
backendValue: backendValues.topPadding
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
Item {
width: 4
@@ -60,6 +63,7 @@ Section {
text: qsTr("Bottom")
tooltip: qsTr("Padding between the content and the bottom edge of the item.")
width: 42
disabledStateSoft: !backendValues.bottomPadding.isAvailable
}
SpinBox {
maximumValue: 10000
@@ -68,17 +72,20 @@ Section {
decimals: 0
backendValue: backendValues.bottomPadding
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
}
Label {
text: qsTr("Horizontal")
disabledState: (!backendValues.leftPadding.isAvailable && !backendValues.rightPadding.isAvailable)
}
SecondColumnLayout {
Label {
text: qsTr("Left")
tooltip: qsTr("Padding between the content and the left edge of the item.")
width: 42
disabledStateSoft: !backendValues.leftPadding.isAvailable
}
SpinBox {
maximumValue: 10000
@@ -87,6 +94,7 @@ Section {
decimals: 0
backendValue: backendValues.leftPadding
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
Item {
width: 4
@@ -97,6 +105,7 @@ Section {
text: qsTr("Right")
tooltip: qsTr("Padding between the content and the right edge of the item.")
width: 42
disabledStateSoft: !backendValues.rightPadding.isAvailable
}
SpinBox {
maximumValue: 10000
@@ -105,12 +114,14 @@ Section {
decimals: 0
backendValue: backendValues.rightPadding
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
}
Label {
text: qsTr("Padding")
tooltip: qsTr("Padding between the content and the edges of the items.")
disabledState: !backendValues.padding.isAvailable
}
SecondColumnLayout {
SpinBox {
@@ -120,6 +131,7 @@ Section {
decimals: 0
backendValue: backendValues.padding
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
}
}

View File

@@ -76,6 +76,7 @@ Section {
Label {
visible: showVerticalAlignment
text: qsTr("Wrap mode")
disabledState: !backendValues.wrapMode.isAvailable
}
ComboBox {
@@ -84,11 +85,13 @@ Section {
backendValue: backendValues.wrapMode
scope: "Text"
model: ["NoWrap", "WordWrap", "WrapAnywhere", "Wrap"]
enabled: backendValue.isAvailable
}
Label {
visible: showElide
text: qsTr("Elide")
disabledState: !backendValues.elide.isAvailable
}
ComboBox {
@@ -97,12 +100,14 @@ Section {
backendValue: backendValues.elide
scope: "Text"
model: ["ElideNone", "ElideLeft", "ElideMiddle", "ElideRight"]
enabled: backendValue.isAvailable
}
Label {
visible: showElide
text: qsTr("Maximum line count")
tooltip: qsTr("Limits the number of lines that the text item will show.")
disabledState: !backendValues.maximumLineCount.isAvailable
}
SpinBox {
@@ -112,6 +117,7 @@ Section {
minimumValue: 0
maximumValue: 10000
decimals: 0
enabled: backendValue.isAvailable
}
Label {
@@ -135,6 +141,7 @@ Section {
Label {
visible: showFormatProperty
text: qsTr("Format")
disabledState: !backendValues.textFormat.isAvailable
}
ComboBox {
scope: "Text"
@@ -142,23 +149,27 @@ Section {
model: ["PlainText", "RichText", "AutoText"]
backendValue: backendValues.textFormat
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
Label {
text: qsTr("Render type")
toolTip: qsTr("Overrides the default rendering type for this item.")
disabledState: !backendValues.renderType.isAvailable
}
ComboBox {
scope: "Text"
model: ["QtRendering", "NativeRendering"]
backendValue: backendValues.renderType
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
Label {
visible: showFontSizeMode
text: qsTr("Font size mode")
toolTip: qsTr("Specifies how the font size of the displayed text is determined.")
disabledState: !backendValues.fontSizeMode.isAvailable
}
ComboBox {
id: fontSizeMode
@@ -167,17 +178,20 @@ Section {
model: ["FixedSize", "HorizontalFit", "VerticalFit", "Fit"]
backendValue: backendValues.fontSizeMode
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
Label {
visible: showFontSizeMode
text: qsTr("Minimum size")
disabledState: !backendValues.minimumPixelSize.isAvailable
&& !backendValues.minimumPointSize.isAvailable
}
SecondColumnLayout {
visible: showFontSizeMode
SpinBox {
enabled: fontSizeMode.currentIndex !== 0
enabled: (fontSizeMode.currentIndex !== 0) || backendValue.isAvailable
minimumValue: 0
maximumValue: 500
decimals: 0
@@ -189,6 +203,7 @@ Section {
text: qsTr("Pixel")
tooltip: qsTr("Minimum font pixel size of scaled text.")
width: 42
disabledStateSoft: !backendValues.minimumPixelSize.isAvailable
}
Item {
@@ -197,7 +212,7 @@ Section {
}
SpinBox {
enabled: fontSizeMode.currentIndex !== 0
enabled: (fontSizeMode.currentIndex !== 0) || backendValue.isAvailable
minimumValue: 0
maximumValue: 500
decimals: 0
@@ -209,6 +224,7 @@ Section {
text: qsTr("Point")
tooltip: qsTr("Minimum font point size of scaled text.")
width: 42
disabledStateSoft: !backendValues.minimumPointSize.isAvailable
}
}
@@ -216,9 +232,11 @@ Section {
visible: showLineHeight
text: qsTr("Line height")
tooltip: qsTr("Line height for the text.")
disabledState: !lineHeightSpinBox.enabled
}
SpinBox {
id: lineHeightSpinBox
visible: showLineHeight
Layout.fillWidth: true
backendValue: (backendValues.lineHeight === undefined) ? dummyBackendValue : backendValues.lineHeight
@@ -226,12 +244,14 @@ Section {
minimumValue: 0
decimals: 2
stepSize: 0.1
enabled: backendValue.isAvailable
}
Label {
visible: showLineHeight
text: qsTr("Line height mode")
toolTip: qsTr("Determines how the line height is specified.")
disabledState: !backendValues.lineHeightMode.isAvailable
}
ComboBox {
visible: showLineHeight
@@ -239,6 +259,7 @@ Section {
model: ["ProportionalHeight", "FixedHeight"]
backendValue: backendValues.lineHeightMode
Layout.fillWidth: true
enabled: backendValue.isAvailable
}
}

View File

@@ -34,7 +34,7 @@ RowLayout {
property variant backendValue
property color textColor: colorLogic.highlight ? colorLogic.textColor : "white"
property string filter: "*.png *.gif *.jpg *.bmp *.jpeg *.svg *.pbm *.pgm *.ppm *.xbm *.xpm"
property string filter: "*.png *.gif *.jpg *.bmp *.jpeg *.svg *.pbm *.pgm *.ppm *.xbm *.xpm *.hdr"
FileResourcesModel {
id: fileModel

View File

@@ -17,11 +17,12 @@ ApplicationWindow {
anchors.fill: parent
ListView {
id: listView
width: parent.width
model: 20
delegate: ItemDelegate {
text: "Item " + (index + 1)
width: parent.width
width: listView.width
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -42,8 +42,7 @@ bool AndroidServiceData::isValid() const
{
return !m_className.isEmpty()
&& (!m_isRunInExternalProcess || !m_externalProcessName.isEmpty())
&& (!m_isRunInExternalLibrary || !m_externalLibName.isEmpty())
&& (m_isRunInExternalLibrary || !m_serviceArguments.isEmpty());
&& (!m_isRunInExternalLibrary || !m_externalLibName.isEmpty());
}
void AndroidServiceData::setClassName(const QString &className)
@@ -264,8 +263,6 @@ QVariant AndroidServiceWidget::AndroidServiceModel::data(const QModelIndex &inde
return tr("The process name must be set for a service run in an external process");
else if (index.column() == 4 && m_services[index.row()].isRunInExternalLibrary())
return tr("The library name must be set for a service run in an external library");
else if (index.column() == 5 && !m_services[index.row()].isRunInExternalLibrary())
return tr("The service arguments must be set for a service not run in an external library");
} else if (role == Qt::EditRole) {
if (index.column() == 0)
return m_services[index.row()].className();
@@ -287,10 +284,6 @@ QVariant AndroidServiceWidget::AndroidServiceModel::data(const QModelIndex &inde
if (m_services[index.row()].isRunInExternalLibrary()
&& m_services[index.row()].externalLibraryName().isEmpty())
return Utils::Icons::WARNING.icon();
} else if (index.column() == 5) {
if (!m_services[index.row()].isRunInExternalLibrary()
&& m_services[index.row()].serviceArguments().isEmpty())
return Utils::Icons::WARNING.icon();
}
}
return {};

View File

@@ -35,6 +35,7 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/projectmacro.h>
#include <utils/algorithm.h>
#include <utils/cpplanguage_details.h>
#include <utils/fileutils.h>
#include <utils/qtcassert.h>
@@ -137,7 +138,7 @@ QStringList CompilerOptionsBuilder::build(ProjectFile::Kind fileKind,
addTargetTriple();
updateFileLanguage(fileKind);
addLanguageVersionAndExtensions();
enableExceptions();
addMsvcExceptions();
addPrecompiledHeaderOptions(usePrecompiledHeaders);
addProjectConfigFileInclude();
@@ -273,6 +274,17 @@ void CompilerOptionsBuilder::addCompilerFlags()
add(m_compilerFlags.flags);
}
void CompilerOptionsBuilder::addMsvcExceptions()
{
if (!m_clStyle)
return;
if (Utils::anyOf(m_projectPart.toolChainMacros, [](const ProjectExplorer::Macro &macro) {
return macro.key == "_CPPUNWIND";
})) {
enableExceptions();
}
}
void CompilerOptionsBuilder::enableExceptions()
{
// With "--driver-mode=cl" exceptions are disabled (clang 8).

View File

@@ -68,6 +68,7 @@ public:
void addExtraCodeModelFlags();
void addPicIfCompilerFlagsContainsIt();
void addCompilerFlags();
void addMsvcExceptions();
void enableExceptions();
void insertWrappedQtHeaders();
void insertWrappedMingwHeaders();

View File

@@ -26,6 +26,8 @@
#include "componentexporter.h"
#include "exportnotification.h"
#include "designdocument.h"
#include "qmldesignerplugin.h"
#include "rewriterview.h"
#include "qmlitemnode.h"
#include "qmlobjectnode.h"
@@ -163,7 +165,6 @@ void AssetExporter::exportComponent(const ModelNode &rootNode)
Component exporter(*this, rootNode);
exporter.exportComponent();
m_components.append(exporter.json());
notifyProgress((m_totalFileCount - m_exportFiles.count()) * 0.8 / m_totalFileCount);
}
void AssetExporter::notifyLoadError(AssetExporterView::LoadState state)
@@ -192,12 +193,22 @@ void AssetExporter::onQmlFileLoaded()
{
QTC_ASSERT(m_view && m_view->model(), qCDebug(loggerError) << "Null model"; return);
qCDebug(loggerInfo) << "Qml file load done" << m_view->model()->fileUrl();
exportComponent(m_view->rootModelNode());
QString error;
if (!m_view->saveQmlFile(&error)) {
ExportNotification::addError(tr("Error saving QML file. %1")
.arg(error.isEmpty()? tr("Unknown") : error));
QmlDesigner::DesignDocument *designDocument = QmlDesigner::QmlDesignerPlugin::instance()
->documentManager()
.currentDesignDocument();
if (designDocument->hasQmlParseErrors()) {
ExportNotification::addError(tr("Cannot export QML. Document \"%1\" have parsing errors.")
.arg(designDocument->displayName()));
} else {
exportComponent(m_view->rootModelNode());
QString error;
if (!m_view->saveQmlFile(&error)) {
ExportNotification::addError(tr("Error saving QML file. %1")
.arg(error.isEmpty()? tr("Unknown") : error));
}
}
notifyProgress((m_totalFileCount - m_exportFiles.count()) * 0.8 / m_totalFileCount);
triggerLoadNextFile();
}

View File

@@ -30,6 +30,7 @@
#include "model.h"
#include "nodeabstractproperty.h"
#include "nodemetainfo.h"
#include "rewriterview.h"
#include "utils/qtcassert.h"
@@ -41,13 +42,16 @@
namespace {
Q_LOGGING_CATEGORY(loggerInfo, "qtc.designer.assetExportPlugin.modelExporter", QtInfoMsg)
static void populateLineage(const QmlDesigner::ModelNode &node, QByteArrayList &lineage)
static QByteArrayList populateLineage(const QmlDesigner::ModelNode &node)
{
QByteArrayList lineage;
if (!node.isValid() || node.type().isEmpty())
return;
lineage.append(node.type());
if (node.hasParentProperty())
populateLineage(node.parentProperty().parentModelNode(), lineage);
return {};
for (auto &info : node.metaInfo().superClasses())
lineage.append(info.typeName());
return lineage;
}
}
@@ -86,8 +90,7 @@ void Component::exportComponent()
ModelNodeParser *Component::createNodeParser(const ModelNode &node) const
{
QByteArrayList lineage;
populateLineage(node, lineage);
QByteArrayList lineage = populateLineage(node);
std::unique_ptr<ModelNodeParser> reader;
for (auto &parserCreator: m_readers) {
std::unique_ptr<ModelNodeParser> r(parserCreator->instance(lineage, node));
@@ -110,6 +113,11 @@ ModelNodeParser *Component::createNodeParser(const ModelNode &node) const
QJsonObject Component::nodeToJson(const ModelNode &node)
{
QJsonObject jsonObject;
// Don't export States, Connection, Timeline etc nodes.
if (!node.isSubclassOf("QtQuick.Item"))
return {};
std::unique_ptr<ModelNodeParser> parser(createNodeParser(node));
if (parser) {
if (parser->uuid().isEmpty()) {
@@ -120,13 +128,16 @@ QJsonObject Component::nodeToJson(const ModelNode &node)
}
jsonObject = parser->json(*this);
} else {
ExportNotification::addError(tr("Error exporting component %1. Parser unavailable.")
.arg(node.id()));
ExportNotification::addError(tr("Error exporting node %1. Cannot parse type %2.")
.arg(node.id()).arg(QString::fromUtf8(node.type())));
}
QJsonArray children;
for (const ModelNode &childnode : node.directSubModelNodes())
children.append(nodeToJson(childnode));
for (const ModelNode &childnode : node.directSubModelNodes()) {
const QJsonObject childJson = nodeToJson(childnode);
if (!childJson.isEmpty())
children.append(childJson);
}
if (!children.isEmpty())
jsonObject.insert(ChildrenTag, children);

View File

@@ -1297,6 +1297,9 @@ void DesignerActionManager::createDefaultAddResourceHandler()
registerAddResourceHandler(AddResourceHandler(ComponentCoreConstants::addImagesDisplayString,
"*.svg",
ModelNodeOperations::addImageToProject));
registerAddResourceHandler(AddResourceHandler(ComponentCoreConstants::addImagesDisplayString,
"*.hdr",
ModelNodeOperations::addImageToProject));
registerAddResourceHandler(AddResourceHandler(ComponentCoreConstants::addFontsDisplayString,
"*.ttf",

View File

@@ -298,7 +298,7 @@ QWidget *ConnectionDelegate::createEditor(QWidget *parent, const QStyleOptionVie
auto addMetaInfoProperties = [&](const NodeMetaInfo& itemMetaInfo, QString itemName){
if (itemMetaInfo.isValid()) {
for (const PropertyName &propertyName : itemMetaInfo.directPropertyNames()) {
for (const PropertyName &propertyName : itemMetaInfo.propertyNames()) {
TypeName propertyType = itemMetaInfo.propertyTypeName(propertyName);
if (!propertyType.isEmpty()) {
//first letter is a reliable item indicator

View File

@@ -112,7 +112,7 @@ void Edit3DView::updateActiveScene3D(const QVariantMap &sceneState)
if (sceneState.contains(sceneKey)) {
qint32 newActiveScene = sceneState[sceneKey].value<qint32>();
edit3DWidget()->canvas()->updateActiveScene(newActiveScene);
rootModelNode().setAuxiliaryData("active3dScene", newActiveScene);
rootModelNode().setAuxiliaryData("active3dScene@Internal", newActiveScene);
}
if (sceneState.contains(selectKey))

View File

@@ -702,6 +702,8 @@ void FormEditorView::instanceInformationsChanged(const QMultiHash<ModelNode, Inf
}
}
scene()->update();
m_currentTool->formEditorItemsChanged(changedItems);
}

View File

@@ -99,15 +99,15 @@ void ImportsWidget::setPossibleImports(QList<Import> possibleImports)
QList<Import> filteredImports;
const QStringList mcuWhiteList = {"QtQuick", "QtQuick.Controls", "QtQuick.Timeline"};
const QStringList mcuBlackList = {"FlowView"};
const QStringList mcuPostiveList = {"QtQuick", "QtQuick.Controls", "QtQuick.Timeline"};
const QStringList mcuNegativeList = {"FlowView"};
if (isQtForMCUs) {
filteredImports = Utils::filtered(possibleImports,
[mcuWhiteList, mcuBlackList](const Import &import) {
return (mcuWhiteList.contains(import.url())
[mcuPostiveList, mcuNegativeList](const Import &import) {
return (mcuPostiveList.contains(import.url())
|| !import.url().startsWith("Qt"))
&& !mcuBlackList.contains(import.url());
&& !mcuNegativeList.contains(import.url());
});
} else {
filteredImports = possibleImports;

View File

@@ -33,6 +33,9 @@
#include <nodehints.h>
#include <nodemetainfo.h>
#include <designdocument.h>
#include <qmldesignerplugin.h>
#include <utils/algorithm.h>
#include <utils/qtcassert.h>
@@ -197,11 +200,58 @@ void ItemLibraryModel::update(ItemLibraryInfo *itemLibraryInfo, Model *model)
forceVisiblity = isItem;
}
DesignDocument *designDocument = QmlDesignerPlugin::instance()
->documentManager()
.currentDesignDocument();
if (valid
&& (isItem || forceVisiblity) //We can change if the navigator does support pure QObjects
&& (entry.requiredImport().isEmpty()
|| model->hasImport(entryToImport(entry), true, true))) {
if (designDocument && designDocument->isQtForMCUsProject()) {
const QList<TypeName> blockTypes = {"QtQuick.AnimatedImage",
"QtQuick.BorderImage",
"QtQuick.FocusScope",
"QtQuick.TextInput",
"QtQuick.TextEdit",
"QtQuick.Flow",
"QtQuick.Grid",
"QtQuick.GridView",
"QtQuick.PathView",
"QtQuick.Controls",
"QtQuick.Controls.BusyIndicator",
"QtQuick.Controls.ButtonGroup",
"QtQuick.Controls.CheckDelegate",
"QtQuick.Controls.Container",
"QtQuick.Controls.ComboBox",
"QtQuick.Controls.DelayButton",
"QtQuick.Controls.Frame",
"QtQuick.Controls.GroupBox",
"QtQuick.Controls.ItemDelegate",
"QtQuick.Controls.Label",
"QtQuick.Controls.Page",
"QtQuick.Controls.PageIndicator",
"QtQuick.Controls.Pane",
"QtQuick.Controls.RadioDelegate",
"QtQuick.Controls.RangeSlider",
"QtQuick.Controls.RoundButton",
"QtQuick.Controls.ScrollView",
"QtQuick.Controls.SpinBox",
"QtQuick.Controls.StackView",
"QtQuick.Controls.SwipeDelegate",
"QtQuick.Controls.SwitchDelegate",
"QtQuick.Controls.ToolBar",
"QtQuick.Controls.ToolButton",
"QtQuick.Controls.TabBar",
"QtQuick.Controls.TabButton",
"QtQuick.Controls.TextArea",
"QtQuick.Controls.TextField",
"QtQuick.Controls.ToolSeparator",
"QtQuick.Controls.Tumbler"};
if (blockTypes.contains(entry.typeName()))
valid = false;
}
if (valid && (isItem || forceVisiblity) //We can change if the navigator does support pure QObjects
&& (entry.requiredImport().isEmpty()
|| model->hasImport(entryToImport(entry), true, true))) {
QString itemSectionName = entry.category();
qCInfo(itemlibraryPopulate) << "Adding:" << entry.typeName() << "to:" << entry.category();
ItemLibrarySection *sectionModel = sectionByName(itemSectionName);

View File

@@ -351,6 +351,8 @@ void ItemLibraryWidget::reloadQmlSource()
void ItemLibraryWidget::setupImportTagWidget()
{
QTC_ASSERT(m_model, return);
const DesignDocument *designDocument = QmlDesignerPlugin::instance()->currentDesignDocument();
const bool isQtForMCUs = designDocument && designDocument->isQtForMCUsProject();
const QStringList imports = m_model->metaInfo().itemLibraryInfo()->showTagsForImports();
@@ -373,11 +375,13 @@ void ItemLibraryWidget::setupImportTagWidget()
return button;
};
for (const QString &importPath : imports) {
const Import import = Import::createLibraryImport(importPath);
if (!m_model->hasImport(import, true, true)
if (!isQtForMCUs) {
for (const QString &importPath : imports) {
const Import import = Import::createLibraryImport(importPath);
if (!m_model->hasImport(import, true, true)
&& m_model->isImportPossible(import, true, true))
flowLayout->addWidget(createButton(importPath));
flowLayout->addWidget(createButton(importPath));
}
}
}

View File

@@ -272,21 +272,68 @@ static bool itemOrImage(const QmlDesigner::NodeMetaInfo &metaInfo)
return false;
}
static QList<QByteArray> prepareNonMcuProperties()
{
QList<QByteArray> result;
const QList<QByteArray> itemProperties = {"layer", "opacity", "gradient", "smooth", "antialiasing",
"border", "baselineOffset", "focus", "activeFocusOnTab"};
const QList<QByteArray> mouseAreaProperties = {"propagateComposedEvents", "preventStealing", "cursorShape",
"scrollGestureEnabled", "drag", "acceptedButtons", "hoverEnabled"};
const QList<QByteArray> flickableProperties = {"boundsBehavior", "boundsMovement",
"flickDeceleration", "flickableDirection",
"leftMargin", "rightMargin", "bottomMargin", "topMargin",
"originX", "originY",
"pixelAligned", "pressDelay", "synchronousDrag"};
const QList<QByteArray> imageProperties = {"mirror", "mipmap", "cache", "autoTransform", "asynchronous",
"sourceSize", "smooth"};
const QList<QByteArray> textProperties = {"elide", "lineHeight", "lineHeightMode", "wrapMode", "style",
"styleColor", "minimumPointSize", "minimumPixelSize", "styleColor",
"fontSizeMode", "renderType", "textFormat", "maximumLineCount"};
const QList<QByteArray> paddingProperties = {"bottomPadding", "topPadding", "leftPadding", "rightPadding"};
const QList<QByteArray> columnRowProperties = {"layoutDirection"};
const QList<QByteArray> listViewProperties = {"cacheBuffer", "highlightRangeMode", "highlightMoveDuration",
"highlightResizeDuration", "preferredHighlightBegin", "layoutDirection",
"preferredHighlightEnd", "highlightFollowsCurrentItem", "keyNavigationWraps",
"snapMode", "highlightMoveVelocity", "highlightResizeVelocity"};
result.append(itemProperties);
result.append(mouseAreaProperties);
result.append(flickableProperties);
result.append(imageProperties);
result.append(textProperties);
result.append(paddingProperties);
result.append(columnRowProperties);
result.append(listViewProperties);
return result;
}
bool PropertyEditorValue::isAvailable() const
{
const QList<QByteArray> mcuProperties = {"layer", "opacity", "gradient", "smooth", "antialiasing"};
const QList<QByteArray> nonMcuProperties = prepareNonMcuProperties();
const QByteArray fontPrefix = {"font"};
const QList<QByteArray> nonMcuFontProperties = {"wordSpacing", "letterSpacing", "hintingPreference",
"kerning", "preferShaping", "capitalization",
"strikeout", "underline", "styleName"};
const QList<QByteArray> mcuTransformProperties = {"rotation", "scale", "transformOrigin"};
const QList<QByteArray> list = name().split('.');
const QByteArray pureName = list.first();
const QByteArray pureName = list.constFirst();
QmlDesigner::DesignDocument *designDocument = QmlDesigner::QmlDesignerPlugin::instance()
->documentManager()
.currentDesignDocument();
if (designDocument && designDocument->isQtForMCUsProject()) {
if (mcuProperties.contains(pureName))
if (pureName == fontPrefix) {
if (nonMcuFontProperties.contains(list.constLast()))
return false;
}
if (nonMcuProperties.contains(pureName))
return false;
if (mcuTransformProperties.contains(pureName) && !itemOrImage(m_modelNode.metaInfo()))
return false;

View File

@@ -207,20 +207,20 @@ void SplineEditor::contextMenuEvent(QContextMenuEvent *e)
{
m_curve.clearActive();
QMenu menu;
auto *menu = new QMenu(this);
EasingCurve mappedCurve = m_canvas.mapTo(m_curve);
int index = mappedCurve.hit(e->pos(), 10);
if (index > 0 && !m_curve.isHandle(index)) {
QAction *deleteAction = menu.addAction(tr("Delete Point"));
QAction *deleteAction = menu->addAction(tr("Delete Point"));
connect(deleteAction, &QAction::triggered, [this, index]() {
m_curve.deletePoint(index);
update();
emit easingCurveChanged(m_curve);
});
QAction *smoothAction = menu.addAction(tr("Smooth Point"));
QAction *smoothAction = menu->addAction(tr("Smooth Point"));
smoothAction->setCheckable(true);
smoothAction->setChecked(m_curve.isSmooth(index));
connect(smoothAction, &QAction::triggered, [this, index]() {
@@ -229,7 +229,7 @@ void SplineEditor::contextMenuEvent(QContextMenuEvent *e)
emit easingCurveChanged(m_curve);
});
QAction *cornerAction = menu.addAction(tr("Corner Point"));
QAction *cornerAction = menu->addAction(tr("Corner Point"));
connect(cornerAction, &QAction::triggered, [this, index]() {
m_curve.breakTangent(index);
update();
@@ -237,7 +237,7 @@ void SplineEditor::contextMenuEvent(QContextMenuEvent *e)
});
} else {
QAction *addAction = menu.addAction(tr("Add Point"));
QAction *addAction = menu->addAction(tr("Add Point"));
connect(addAction, &QAction::triggered, [&]() {
m_curve.addPoint(m_canvas.mapFrom(e->pos()));
m_curve.makeSmooth(m_curve.active());
@@ -246,13 +246,13 @@ void SplineEditor::contextMenuEvent(QContextMenuEvent *e)
});
}
QAction *zoomAction = menu.addAction(tr("Reset Zoom"));
QAction *zoomAction = menu->addAction(tr("Reset Zoom"));
connect(zoomAction, &QAction::triggered, [&]() {
m_canvas.setScale(1.0);
update();
});
menu.exec(e->globalPos());
menu->exec(e->globalPos());
e->accept();
}

View File

@@ -548,7 +548,6 @@ QString RewriterView::auxiliaryDataAsQML() const
for (const auto &node : allModelNodes()) {
QHash<PropertyName, QVariant> data = node.auxiliaryData();
if (!data.isEmpty()) {
hasAuxData = true;
if (columnCount > 80) {
str += "\n";
columnCount = 0;
@@ -567,7 +566,6 @@ QString RewriterView::auxiliaryDataAsQML() const
keys.sort();
for (const QString &key : keys) {
if (key.endsWith("@NodeInstance"))
continue;
@@ -579,7 +577,7 @@ QString RewriterView::auxiliaryDataAsQML() const
if (!key.contains(safeName))
continue;
hasAuxData = true;
const QVariant value = data.value(key.toUtf8());
QString strValue = value.toString();

View File

@@ -35,7 +35,7 @@ ListModel {
ListElement {
projectName: "CoffeeMachine"
qmlFileName: "ApplicationFlowForm.ui.qml"
qmlFileName: "CoffeeMachine.qml"
thumbnail: "images/coffeemachinedemo_thumbnail.png"
displayName: "Coffee Machine"
}

View File

@@ -91,4 +91,46 @@ ListModel {
thumbnail: "images/what_is_new_15.png"
url: "https://www.youtube.com/watch?v=e-HAZrisi5o"
}
ListElement {
displayName: "Qt Design Studio QuickTip: UI Navigation"
thumbnail: "images/Qt_QT_nav.png"
url: "https://youtu.be/RfEYO-5Mw6s"
}
ListElement {
displayName: "Qt Design Studio QuickTip: Text Element"
thumbnail: "images/Qt_QT_textElement.png"
url: "https://youtu.be/yOUdg1o2KJM"
}
ListElement {
displayName: "Qt Design Studio QuickTip: Animated Image"
thumbnail: "images/Qt_QT_animatedImage.png"
url: "https://youtu.be/DVWd_xMMgvg"
}
ListElement {
displayName: "Qt Design Studio QuickTip: Slider Control"
thumbnail: "images/Qt_QT_sliderControl.png"
url: "https://youtu.be/Ed8WS03C-Vk"
}
ListElement {
displayName: "Qt Design Studio QuickTip: Bindings"
thumbnail: "images/Qt_QT_bindings.png"
url: "https://youtu.be/UfvA04CIXv0"
}
ListElement {
displayName: "Sketch Bridge Tutorial - Part 1"
thumbnail: "images/sketchTutorial_1.png"
url: "https://www.qt.io/blog/qt-design-studio-sketch-bridge-tutorial-part-1"
}
ListElement {
displayName: "Sketch Bridge Tutorial - Part 2"
thumbnail: "images/sketchTutorial_2.png"
url: "https://www.qt.io/blog/qt-design-studio-sketch-bridge-tutorial-part-2"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

@@ -650,8 +650,6 @@ TEST_F(CompilerOptionsBuilder, BuildAllOptions)
"-x",
"c++",
"-std=c++17",
"-fcxx-exceptions",
"-fexceptions",
"-DprojectFoo=projectBar",
"-I", IsPartOfHeader("wrappedQtHeaders"),
"-I", IsPartOfHeader(toNative("wrappedQtHeaders/QtCore").toStdString()),
@@ -674,6 +672,44 @@ TEST_F(CompilerOptionsBuilder, BuildAllOptionsCl)
compilerOptionsBuilder.build(ProjectFile::CXXSource, CppTools::UsePrecompiledHeaders::No);
ASSERT_THAT(compilerOptionsBuilder.options(),
ElementsAre("-nostdinc",
"-nostdinc++",
"--driver-mode=cl",
"/Zs",
"-m64",
"--target=x86_64-apple-darwin10",
"/TP",
"/std:c++17",
"-fms-compatibility-version=19.00",
"-DprojectFoo=projectBar",
"-D__FUNCSIG__=\"\"",
"-D__FUNCTION__=\"\"",
"-D__FUNCDNAME__=\"\"",
"-I", IsPartOfHeader("wrappedQtHeaders"),
"-I", IsPartOfHeader(toNative("wrappedQtHeaders/QtCore").toStdString()),
"-I", toNative("/tmp/path"),
"-I", toNative("/tmp/system_path"),
"/clang:-isystem",
"/clang:" + toNative(CLANG_INCLUDE_DIR ""),
"/clang:-isystem",
"/clang:" + toNative("/tmp/builtin_path")));
}
TEST_F(CompilerOptionsBuilder, BuildAllOptionsClWithExceptions)
{
projectPart.toolchainType = ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID;
projectPart.toolChainMacros.append(ProjectExplorer::Macro{"_CPPUNWIND", "1"});
CppTools::CompilerOptionsBuilder compilerOptionsBuilder(projectPart,
CppTools::UseSystemHeader::No,
CppTools::UseTweakedHeaderPaths::Yes,
CppTools::UseLanguageDefines::No,
CppTools::UseBuildSystemWarnings::No,
"dummy_version",
"");
compilerOptionsBuilder.build(ProjectFile::CXXSource, CppTools::UsePrecompiledHeaders::No);
ASSERT_THAT(compilerOptionsBuilder.options(),
ElementsAre("-nostdinc",
"-nostdinc++",

View File

@@ -25,6 +25,7 @@
#include <QtGlobal>
#ifdef CLANG_UNIT_TESTS
#include <clang-c/Index.h>
#if CINDEX_VERSION_MAJOR == 0 && CINDEX_VERSION_MINOR == 59
@@ -32,6 +33,7 @@
#else
# define DISABLED_FOR_CLANG_10(x) x
#endif
#endif
#ifdef Q_OS_WIN
# define DISABLED_ON_WINDOWS(x) DISABLED_##x

View File

@@ -65,6 +65,12 @@ class StringCache : public testing::Test
protected:
void SetUp()
{
mockStorageFetchDirectyId = [&](Utils::SmallStringView string) {
return mockStorage.fetchDirectoryId(string);
};
mockStorageFetchDirectyPath = [&](int id) {
return mockStorage.fetchDirectoryPath(id);
};
std::sort(filePaths.begin(), filePaths.end(), [](auto &f, auto &l) {
return compare(f, l) < 0;
});
@@ -82,12 +88,8 @@ protected:
protected:
NiceMock<MockSqliteDatabase> mockDatabase;
NiceMock<MockFilePathStorage> mockStorage{mockDatabase};
StorageIdFunction mockStorageFetchDirectyId = [&](Utils::SmallStringView string) {
return mockStorage.fetchDirectoryId(string);
};
StorageStringFunction mockStorageFetchDirectyPath = [&](int id) {
return mockStorage.fetchDirectoryPath(id);
};
StorageIdFunction mockStorageFetchDirectyId;
StorageStringFunction mockStorageFetchDirectyPath;
Cache cache;
typename Cache::MutexType &mockMutex = cache.mutex();
Utils::PathString filePath1{"/file/pathOne"};