Merge remote-tracking branch 'origin/4.12'

Change-Id: I296a61fe43aea134de9e7a6ee8042af3f45f5e99
This commit is contained in:
Eike Ziller
2020-04-23 11:09:15 +02:00
63 changed files with 616 additions and 223 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -124,6 +124,15 @@
To switch between Windows line endings (CRLF) and Unix line endings (LF),
select the ending style on the editor toolbar (6).
To set the line endings to use for all projects by default, select
\uicontrol Tools > \uicontrol Options > \uicontrol {Text Editor} >
\uicontrol Behavior, and then select the ending style in the
\uicontrol {Default line endings} field.
To set the line endings to use for a project, select \uicontrol Projects >
\uicontrol {Project Settings} > \uicontrol Editor. For more information,
see \l {Specifying Editor Settings}.
\section1 Splitting the Editor View
Split the editor view or open the editor in a new window when you want to

View File

@@ -213,7 +213,7 @@
\b {How can I make use of my multi-core CPU with \QC?}
On Linux and \macos, go to \uicontrol Project mode, select your configuration
On Linux and \macos, go to \uicontrol Projects mode, select your configuration
in the \uicontrol {Build Settings}, locate the \uicontrol {Build Steps}, and add the
following value, where \c{<num>} is the amount of cores in your CPU:
\c{-j <num>}

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -37,7 +37,7 @@
\title Deploying to Devices
Deploy configurations in the \uicontrol Project mode
Deploy configurations in the \uicontrol Projects mode
\uicontrol {Run Settings} handle the packaging of the application as an
executable and copying it to a location you want to run the executable at.
The files can be copied to a location in the file system of the development

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2018 The Qt Company Ltd.
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -71,6 +71,8 @@
\li \l{File Encoding}
\li \l{Selecting Line Ending Style}
\li \l{Moving to Symbol Definition or Declaration}
\li \l{Configuring Fonts}

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -48,8 +48,9 @@
To run executable files without deploying them first, select \uicontrol Build >
\uicontrol {Run Without Deployment}. To make this the default option, deselect the
\uicontrol Tools > \uicontrol Options > \uicontrol Project >
\uicontrol {Always deploy project before running it} option.
\uicontrol Tools > \uicontrol Options > \uicontrol {Build & Run} >
\uicontrol General > \uicontrol {Always deploy project before running it}
check box.
To run applications:

View File

@@ -91,10 +91,12 @@
\list
\li \l {Creating Qt Quick Projects}
\li \l {Editing QML Files in Design Mode}
\li \l {Creating UIs}
\list
\li \l {Creating Components}
\list
\li \l{Editing 2D Content}
\li \l{Creating Buttons}
\li \l{Creating Scalable Buttons and Borders}
\endlist

View File

@@ -46,9 +46,8 @@
\li \l {Editing QML Files in Design Mode}
You can use the \uicontrol {Form Editor} or the
\uicontrol {Text Editor} in the Design mode to
develop Qt Quick applications.
You can use several different editors and views in the
Design mode to develop Qt Quick applications.
\li \l {Creating UIs}

View File

@@ -37,7 +37,7 @@
name and one or several comments. The comments have a title, author, and
comment text.
\image qtquick-annotations.png "Annotations displayed in the Form Editor tab"
\image qtquick-annotations.png "Annotations displayed in the Form Editor view"
Annotations are saved in the end of QML files when you save the file. They
do not affect the QML performance in any way.

View File

@@ -31,7 +31,7 @@
/*!
\contentspage index.html
\previouspage quick-components.html
\previouspage qtquick-form-editor.html
\page quick-buttons.html
\nextpage quick-scalable-image.html

View File

@@ -37,7 +37,7 @@
\else
\previouspage creator-using-qt-quick-designer.html
\endif
\nextpage quick-buttons.html
\nextpage qtquick-form-editor.html
\title Creating Components
@@ -64,14 +64,14 @@
The \uicontrol {Qt Quick Application} wizards for a particular platform add
the import statements automatically. You can remove import statements in
\uicontrol {QML Imports}
\uicontrol {QML Imports}.
\uicontrol {Assets} displays the images and other files that you copy
to the project folder (to the same subfolder as the QML files).
\section1 Adding Components to Designs
\image qmldesigner-visual-editor.png "Design mode"
\image studio-design-mode.png "Design mode"
\list 1
\li Drag and drop components from the \uicontrol Library (2) to the
@@ -85,6 +85,8 @@
\li Add states to apply sets of changes to the properties of one or
several components in the \uicontrol States view (6). For more
information, see \l{Adding States}.
\li Animate component properties in the \uicontrol Timeline view (7).
For more information, see \l{Creating Animations}.
\endlist
\section1 Using Basic QML Types
@@ -564,11 +566,14 @@
\endlist
The following sections contain examples of how to create some common
components:
The following sections contain more information about how to use the
\uicontrol {Form Editor} to edit 2D content, as well as examples of
how to create some common components using basic QML types:
\list
\li \l{Editing 2D Content}
\li \l{Creating Buttons}
\li \l{Creating Scalable Buttons and Borders}

View File

@@ -43,150 +43,68 @@
\title Editing QML Files in Design Mode
\QC opens \l{Qt Quick UI Forms}{UI forms} (ui.qml files) in the
\uicontrol {Form Editor} tab in the Design mode. It is
\uicontrol {Form Editor} view in the Design mode. It is
recommended that you use UI forms for components that you want to
edit in the Design mode.
\if defined(qtcreator)
\image qmldesigner-visual-editor.png "Visual editor"
\else
\image studio-design-mode.png "Design mode"
\endif
To manage your project in the Design mode:
The Design mode contains different views for designing UIs. To open the
following views, select \uicontrol Window > \uicontrol Views:
\list
\li \uicontrol {Form Editor} (1) provides a canvas for designing 2D UIs.
For more information, see \l {Editing 2D Content}.
\li \uicontrol Canvas (1) is the working area where you create QML
components and design applications. In the \uicontrol {Form Editor}
tab, you can use a visual editor to design UIs, and in the
\uicontrol {Text Editor} tab, you can use a code editor to edit the
QML code generated by the visual editor.
\li \uicontrol {3D Editor} provides an editor for files you created
using 3D graphics applications and stored in one of the supported
formats. For more information, see \l{Editing 3D Scenes}.
\li Use the sidebars to select QML types to use in the project, to
specify properties for them, and to
view them in a tree structure, as well as to create connections
and browse projects and files. You can select the content of the
sidebars in the sidebar menu:
\li \uicontrol {Text Editor} provides a code editor for editing the QML
code generated by the visual editors. For more information, see
\l {Working in Edit Mode}.
\list
\li \uicontrol {Library} (2) displays the building blocks that you
can use to design applications: predefined QML types, your own
QML components, or Qt Quick Controls that you import to the
project, and other resources. For more information, see
\l {Creating Components}.
\li \uicontrol {Library} (2) displays the building blocks that you
can use to design applications: predefined QML types, your own
QML components, or Qt Quick Controls that you import to the
project, and other resources. For more information, see
\l {Creating Components}.
\li \uicontrol {Navigator} (3) displays the items in the current QML
file as a tree structure. For more information, see
\l {Managing Item Hierarchy}.
\li \uicontrol {Navigator} (3) displays the items in the current QML
file as a tree structure. For more information, see
\l {Managing Item Hierarchy}.
\li \uicontrol {Properties} (4) organizes the properties of the
selected component. You can change the properties also in the
\uicontrol {Text Editor}. For more information, see
\l {Specifying Item Properties}.
\li \uicontrol {Properties} (4) organizes the properties of the
selected item. You can change the properties also in the
\uicontrol {Text Editor}. For more information, see
\l {Specifying Item Properties}.
\li \uicontrol Connections (5) enables you to create connections
between objects, signals, and object properties. For more
information, see \l{Adding Connections}.
\li \uicontrol Connections (5) enables you to create connections
between objects, signals, and object properties. For more
information, see \l{Adding Connections}.
\li \uicontrol {File System} shows all files in the currently
selected directory. For more information, see
\l{Viewing the File System}.
\li \uicontrol {File System} shows all files in the currently
selected directory. For more information, see
\l{Viewing the File System}.
\li \uicontrol {Open Documents} shows currently open files.
\li \uicontrol {Open Documents} shows currently open files.
\li \uicontrol {Projects} shows a list of projects open in the
current session. For more information, see
\l{Viewing Project Files}.
\li \uicontrol {Projects} shows a list of projects open in the
current session. For more information, see
\l{Viewing Project Files}.
\endlist
\li \uicontrol {States} view (6) displays the different states of the item.
\li \uicontrol {States} (6) displays the different states of the item.
QML states typically describe user interface configurations, such as
the UI controls, their properties and behavior and the available
actions. For more information, see \l{Adding States}.
\if defined(qtdesignstudio)
\li \uicontrol Timeline view (7) provides a timeline and keyframe based
\li \uicontrol Timeline (7) provides a timeline and keyframe based
editor that enables you to animate the properties of UI components.
\endif
For more information, see \l{Creating Animations}.
\endlist
\section1 Snapping to Parent and Sibling Items
You design applications on the canvas by placing items on it.
When you are working on a design, you can use snapping to align
items on the canvas. Click the \inlineimage snapping.png
button to have the items snap to their parent or sibling items. Snapping
lines automatically appear to help you position the items.
Click the \inlineimage snapping_and_anchoring.png
button to anchor the item to the items that you snap to.
Choose \uicontrol Tools > \uicontrol Options > \uicontrol {Qt Quick} >
\uicontrol {\QMLD} to specify settings for snapping. In the
\uicontrol {Parent item padding} field, specify the
distance in pixels between the parent item and the snapping lines. In the
\uicontrol {Sibling item spacing} field, specify the distance in pixels between
sibling items and the snapping lines.
The following image shows the snapping lines (1) when
\uicontrol {Parent item padding} is set to 5 pixels.
\image qmldesigner-snap-margins.png "Snapping lines on canvas"
\section1 Hiding Item Boundaries
The Design mode displays the boundaries of items on the canvas. To hide
the boundaries, click the \inlineimage boundingrect.png
button.
\section1 Selecting Items
When you point the mouse to overlapping items, the frontmost item is
selected by default. However, items that do not have any content, such as
the mouse area, are typically located in front of items that do have
content, such as rectangles or border images. To select items with content
by default, click the
\inlineimage qmldesigner-only-select-items-with-content.png
button.
\section1 Previewing Component Size
The width and height of the root item in a QML file determine the size of
the component. You can reuse components, such as buttons, in different
sizes in other QML files and design UIs for use with different device
profiles, screen resolution, or screen orientation. The component size
might also be zero (0,0) if its final size is determined by property
bindings.
To experiment with different component sizes, enter values in the
\uicontrol {Override Width} and \uicontrol {Override Height} fields (1) on
the canvas toolbar. The changes are displayed on the canvas (2)
and in the \uicontrol States view (3), but the property
values are not changed permanently in the QML file. You can permanently
change the property values in the \uicontrol Properties view (4).
\image qmldesigner-preview-size.png "Canvas width and height"
\section1 Specifying Canvas Size
To change the canvas size, select \uicontrol Tools > \uicontrol Options >
\uicontrol {Qt Quick} > \uicontrol {\QMLD} and
specify the canvas width and height in the \uicontrol Canvas group.
\section1 Refreshing the Canvas
When you open QML files in the Design mode, the items in the file are drawn
on the canvas. When you edit the item properties, the QML file and
the image on the canvas might get out of sync. For example, when you change
the position of an item within a column or a row, the new position might
not be displayed correctly on the canvas.
To refresh the image on the canvas, press \key R or select the
\inlineimage reset.png
(\uicontrol {Reset View}) button.
You can move the views anywhere on the screen and save them as
\e workspaces, as instructed in \l {Managing Workspaces}.
*/

View File

@@ -0,0 +1,110 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
**
****************************************************************************/
/*!
\contentspage index.html
\page qtquick-form-editor.html
\previouspage quick-components.html
\nextpage quick-buttons.html
\title Editing 2D Content
You design applications in the \uicontrol {Form Editor} by placing items
into it.
\section1 Snapping to Parent and Sibling Items
When you are working on a design, you can use snapping to align
items in the \uicontrol {Form Editor}. Click the \inlineimage snapping.png
button to have the items snap to their parent or sibling items. Snapping
lines automatically appear to help you position the items.
Click the \inlineimage snapping_and_anchoring.png
button to anchor the item to the items that you snap to.
Choose \uicontrol Tools > \uicontrol Options > \uicontrol {Qt Quick} >
\uicontrol {\QMLD} to specify settings for snapping. In the
\uicontrol {Parent item padding} field, specify the
distance in pixels between the parent item and the snapping lines. In the
\uicontrol {Sibling item spacing} field, specify the distance in pixels between
sibling items and the snapping lines.
The following image shows the snapping lines (1) when
\uicontrol {Parent item padding} is set to 5 pixels.
\image qmldesigner-snap-margins.png "Snapping lines on canvas"
\section1 Hiding Item Boundaries
The \uicontrol {Form Editor} displays the boundaries of items.
To hide them, select the \inlineimage boundingrect.png
button.
\section1 Selecting Items
When you point the mouse to overlapping items, the frontmost item is
selected by default. However, items that do not have any content, such as
the mouse area, are typically located in front of items that do have
content, such as rectangles or border images. To select items with content
by default, click the
\inlineimage qmldesigner-only-select-items-with-content.png
button.
\section1 Previewing Component Size
The width and height of the root item in a QML file determine the size of
the component. You can reuse components, such as buttons, in different
sizes in other QML files and design UIs for use with different device
profiles, screen resolution, or screen orientation. The component size
might also be zero (0,0) if its final size is determined by property
bindings.
To experiment with different component sizes, enter values in the
\uicontrol {Override Width} and \uicontrol {Override Height} fields (1) on
the canvas toolbar. The changes are displayed in the \uicontrol {Form Editor}
(2) and in the \uicontrol States view (3), but the property
values are not changed permanently in the QML file. You can permanently
change the property values in the \uicontrol Properties view (4).
\image qmldesigner-preview-size.png "Canvas width and height"
\section1 Specifying Canvas Size
To change the canvas size, select \uicontrol Tools > \uicontrol Options >
\uicontrol {Qt Quick} > \uicontrol {\QMLD} and
specify the canvas width and height in the \uicontrol Canvas group.
\section1 Refreshing the Form Editor Contents
When you open QML files in the Design mode, the items in the file are drawn
in the \uicontrol {Form Editor}. When you edit the item properties, the QML
file and the contents of the editor might get out of sync. For example, when
you change the position of an item within a column or a row, the new
position might not be displayed correctly in the \uicontrol {Form Editor}.
To refresh the contents of the \uicontrol {Form Editor}, press \key R or
select the \inlineimage reset.png
(\uicontrol {Reset View}) button.
*/

View File

@@ -47,8 +47,7 @@
\endif
To preview any QML file that belongs to the project, right-click the project
name in the \uicontrol Project tab in the \uicontrol Navigator, and select
\uicontrol {Preview file}.
name in the \uicontrol Projects view, and select \uicontrol {Preview file}.
To preview the whole UI, select \uicontrol {Show Live Preview}
when viewing the main QML UI file of the project.

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Creator documentation.
@@ -52,17 +52,9 @@
{here}.
\if defined(qtcreator)
\section1 Enabling the Timeline Editor
The \uicontrol Timeline view is not visible in \QC by default. To enable
it, select \uicontrol Tools > \uicontrol Options > \uicontrol {Qt Quick} >
\uicontrol {Qt Quick Designer} > \uicontrol {Enable Timeline editor}.
Select \uicontrol {Restart Now} to restart \QC with the \uicontrol Timeline
view visible.
To be able to create timelines, you also need the \l {Qt Quick Timeline}
module, which is delivered with Qt 5.14, and later. For more
information about adding the module to an older Qt version, see
add-on module, which you can install with Qt 5.14, and later. For more
information about adding the module to an older Qt version, see
\l{Adding Qt Quick Timeline Module to Qt Installations}.
\endif
@@ -77,9 +69,7 @@
\list 1
\li In the \uicontrol Navigator, select the item to animate.
\li Select the \uicontrol Timeline tab to open the \uicontrol Timeline
view.
\li Select the \inlineimage plus.png
\li In the \uicontrol Timeline view, select the \inlineimage plus.png
(\uicontrol {Add Timeline (A)}) button, or press \key {A} to
specify settings for the timeline and running the animation
in the \uicontrol {Timeline Settings} dialog.
@@ -144,7 +134,7 @@
\section1 Managing Keyframes
To animate components in the \uicontrol Timeline view, move to a frame
on the timeline and specify changes in the values of a property. \QDS
on the timeline and specify changes in the values of a property. \QC
automatically adds keyframes between two keyframes, and sets their values
evenly to create an appearance of movement or transformation.
@@ -160,7 +150,8 @@
\li Select the \uicontrol {To Start (Home)}, \uicontrol {Previous (,)},
or \uicontrol {Next (.)} buttons (3), or use the keyboard shortcuts
to move to the first, previous, or next frame on the timeline.
\li Enter the number of a frame in the field (4) to move to that frame.
\li Enter the number of a frame in the current keyframe field (4) to
move to that frame.
\li Select the \uicontrol Previous and \uicontrol Next buttons next to
a property name on the timeline (5) to move to the previous or next
keyframe for that property.
@@ -231,13 +222,11 @@
You can view the animation on the canvas by moving the playhead along the
timeline.
\if defined(qtdesignstudio)
To preview the animation, select the \uicontrol {Play (Space)}
button or press \key Space. To preview the whole UI, select the
\inlineimage live_preview.png
(\uicontrol {Show Live Preview}) button on the canvas toolbar
or press \key {Alt+P}.
\endif
\section1 Editing Easing Curves
@@ -247,7 +236,7 @@
timeline are \e linear, which means that they move from the beginning to
the end at a constant speed. You can use the \uicontrol {Easing Curve Editor}
to edit the easing curve between two keyframes. You can also use the more
advanced \uicontrol {Curve Editor (C)} to edit the curves for the whole
advanced \uicontrol {Animation Curve Editor} to edit the curves for the whole
animation.
\section2 Attaching Easing Curves to Keyframes
@@ -306,23 +295,24 @@
\section1 Editing Animation Curves
In the curve editor, you can view and modify the whole animation curve. You
In the animation curve editor, you can view and modify the whole animation
curve. You
can insert keyframes to the curve and drag them and the point handlers to
modify the curve. You can modify the appearance of the curve in the style
editor.
You can also edit easing curves that you added with the easing curve editor.
\image studio-curve-editor.png "Curve Editor"
\image studio-curve-editor.png "Animation Curve Editor"
To edit animation curves:
\list 1
\li In the \uicontrol Timeline view, insert at least one keyframe.
\li Select \inlineimage curveGraphIcon.png
(\uicontrol {Curve Editor (C)} on the toolbar or press \key C
to open the curve editor.
\li Right-click in the curve editor, and select
(\uicontrol {Animation Curve Editor}) on the toolbar or press \key C
to open the animation curve editor.
\li Right-click in the animation curve editor, and select
\uicontrol {Insert Keyframe} to add a keyframe.
\li Select keyframes to display the easing curves attached to them.
To select multiple keyframes, press and hold \key Ctrl.

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Design Studio documentation.
@@ -70,6 +70,7 @@
\list
\li \l{Creating Components}
\list
\li \l{Editing 2D Content}
\li \l{Creating Buttons}
\li \l{Creating Scalable Buttons and Borders}
\endlist

View File

@@ -800,7 +800,10 @@ def qdump__std____1__shared_ptr(d, value):
def qdump__std__unique_ptr(d, value):
p = d.extractPointer(value)
if value.type.size() == d.ptrSize():
p = d.extractPointer(value)
else:
_, p = value.split("pp"); # For custom deleters.
if p == 0:
d.putValue("(null)")
d.putNumChild(0)

View File

@@ -34,6 +34,7 @@ enum InformationName
{
NoName,
NoInformationChange = NoName,
AllStates,
Size,
BoundingRect,
Transform,

View File

@@ -1061,6 +1061,7 @@ static QVector<InformationContainer> createInformationVector(const QList<ServerN
informationVector.append(InformationContainer(instance.instanceId(), PenWidth, instance.penWidth()));
informationVector.append(InformationContainer(instance.instanceId(), IsAnchoredByChildren, instance.isAnchoredByChildren()));
informationVector.append(InformationContainer(instance.instanceId(), IsAnchoredBySibling, instance.isAnchoredBySibling()));
informationVector.append(InformationContainer(instance.instanceId(), AllStates, instance.allStates()));
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, PropertyName("anchors.fill"), instance.hasAnchor("anchors.fill")));
informationVector.append(InformationContainer(instance.instanceId(), HasAnchor, PropertyName("anchors.centerIn"), instance.hasAnchor("anchors.centerIn")));

View File

@@ -871,6 +871,11 @@ void ObjectNodeInstance::deactivateState()
{
}
QStringList ObjectNodeInstance::allStates() const
{
return {};
}
void ObjectNodeInstance::populateResetHashes()
{
QmlPrivateGate::registerCustomData(object());

View File

@@ -148,6 +148,7 @@ public:
virtual void activateState();
virtual void deactivateState();
virtual QStringList allStates() const;
void populateResetHashes();
bool hasValidResetBinding(const PropertyName &propertyName) const;

View File

@@ -232,6 +232,20 @@ QList<QQuickItem *> QuickItemNodeInstance::allItemsRecursive() const
return itemList;
}
QStringList QuickItemNodeInstance::allStates() const
{
QStringList list;
QList<QObject*> stateList = DesignerSupport::statesForItem(quickItem());
for (QObject *state : stateList) {
QQmlProperty property(state, "name");
if (property.isValid())
list.append(property.read().toString());
}
return list;
}
QRectF QuickItemNodeInstance::contentItemBoundingBox() const
{
if (contentItem()) {
@@ -611,8 +625,8 @@ void QuickItemNodeInstance::setPropertyVariant(const PropertyName &name, const Q
if (ignoredProperties().contains(name))
return;
if (name == "state")
return; // states are only set by us
if (name == "state" && isRootNodeInstance())
return; // states on the root item are only set by us
if (name == "height") {
m_height = value.toDouble();
@@ -649,8 +663,8 @@ void QuickItemNodeInstance::setPropertyBinding(const PropertyName &name, const Q
if (ignoredProperties().contains(name))
return;
if (name == "state")
return; // states are only set by us
if (name == "state" && isRootNodeInstance())
return; // states on the root item are only set by us
if (name.startsWith("anchors.") && isRootNodeInstance())
return;

View File

@@ -96,6 +96,7 @@ public:
void doComponentComplete() override;
QList<QQuickItem*> allItemsRecursive() const override;
QStringList allStates() const override;
protected:
explicit QuickItemNodeInstance(QQuickItem*);

View File

@@ -199,6 +199,18 @@ Internal::ObjectNodeInstance::Pointer ServerNodeInstance::createInstance(QObject
return instance;
}
QString static getErrorString(QQmlEngine *engine, const QString &componentPath)
{
QQmlComponent component(engine, componentPath);
QObject *o = component.create(nullptr);
delete o;
QString s;
for (const QQmlError &error : component.errors())
s.append(error.toString());
return s;
}
ServerNodeInstance ServerNodeInstance::create(NodeInstanceServer *nodeInstanceServer,
const InstanceContainer &instanceContainer,
ComponentWrap componentWrap)
@@ -215,8 +227,11 @@ ServerNodeInstance ServerNodeInstance::create(NodeInstanceServer *nodeInstanceSe
nodeInstanceServer->sendDebugOutput(DebugOutputCommand::ErrorType, QLatin1String("Custom parser object could not be created."), instanceContainer.instanceId());
} else if (!instanceContainer.componentPath().isEmpty()) {
object = Internal::ObjectNodeInstance::createComponent(instanceContainer.componentPath(), nodeInstanceServer->context());
if (object == nullptr)
nodeInstanceServer->sendDebugOutput(DebugOutputCommand::ErrorType, QString("Component with path %1 could not be created.").arg(instanceContainer.componentPath()), instanceContainer.instanceId());
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());
if (object == nullptr)
@@ -646,6 +661,14 @@ QList<ServerNodeInstance> ServerNodeInstance::stateInstances() const
return m_nodeInstance->stateInstances();
}
QStringList ServerNodeInstance::allStates() const
{
if (isValid())
return m_nodeInstance->allStates();
return {};
}
Internal::ObjectNodeInstance::Pointer ServerNodeInstance::internalInstance() const
{
return m_nodeInstance;

View File

@@ -164,6 +164,7 @@ public:
QSharedPointer<Internal::ObjectNodeInstance> internalInstance() const;
QList<ServerNodeInstance> stateInstances() const;
QStringList allStates() const;
static bool isSubclassOf(QObject *object, const QByteArray &superTypeName);

View File

@@ -52,5 +52,8 @@ Column {
}
}
}
PaddingSection {
}
}

View File

@@ -83,4 +83,7 @@ Column {
}
}
}
PaddingSection {
}
}

View File

@@ -115,4 +115,7 @@ Column {
}
}
}
PaddingSection {
}
}

View File

@@ -67,4 +67,7 @@ Column {
}
}
}
PaddingSection {
}
}

View File

@@ -805,6 +805,7 @@ namespace ADS
d->m_workspaces.insert(1, clone);
d->m_workspaceDateTimes
.insert(clone, workspaceNameToFileName(clone).toFileInfo().lastModified());
emit workspaceListChanged();
return true;
}
return false;

View File

@@ -107,6 +107,7 @@ void ToolTip::show(const QPoint &pos,
layout->setContentsMargins(0, 0, 0, 0);
tooltipWidget->setLayout(layout);
auto label = new QLabel;
label->setObjectName("qcWidgetTipTopLabel");
label->setTextFormat(format);
label->setText(content);
layout->addWidget(label);

View File

@@ -170,7 +170,7 @@ static FilePath jsonObjectFilename(const QJsonObject &object)
const QString workingDir = QDir::fromNativeSeparators(object["directory"].toString());
FilePath fileName = FilePath::fromString(QDir::fromNativeSeparators(object["file"].toString()));
if (fileName.toFileInfo().isRelative())
fileName = FilePath::fromString(workingDir + "/" + fileName.toString()).canonicalPath();
fileName = FilePath::fromString(QDir::cleanPath(workingDir + "/" + fileName.toString()));
return fileName;
}

View File

@@ -354,8 +354,12 @@ bool isFlowTransitionItem(const SelectionContext &context)
bool isFlowActionItemItem(const SelectionContext &context)
{
const ModelNode selectedNode = context.currentSingleSelectedNode();
return context.singleNodeIsSelected()
&& QmlFlowActionAreaNode::isValidQmlFlowActionAreaNode(context.currentSingleSelectedNode());
&& (QmlFlowActionAreaNode::isValidQmlFlowActionAreaNode(selectedNode)
|| QmlVisualNode::isFlowDecision(selectedNode)
|| QmlVisualNode::isFlowWildcard(selectedNode));
}
bool isFlowItemOrTransition(const SelectionContext &context)

View File

@@ -1052,16 +1052,17 @@ void addTransition(const SelectionContext &selectionContext)
{
if (selectionContext.view()) {
AbstractView *view = selectionContext.view();
QmlFlowItemNode targetItem = selectionContext.targetNode();
QmlFlowActionAreaNode actionArea = selectionContext.currentSingleSelectedNode();
QmlFlowTargetNode targetNode = selectionContext.targetNode();
QmlFlowTargetNode sourceNode = selectionContext.currentSingleSelectedNode();
QTC_ASSERT(targetNode.isValid(), return);
QTC_ASSERT(sourceNode.isValid(), return);
QTC_ASSERT(targetItem.isValid(), return);
QTC_ASSERT(actionArea.isValid(), return);
view->executeInTransaction("DesignerActionManager:addTransition",
[view, targetItem, &actionArea](){
actionArea.assignTargetFlowItem(targetItem);
[view, targetNode, &sourceNode](){
sourceNode.assignTargetItem(targetNode);
});
}
}

View File

@@ -545,10 +545,13 @@ void FormEditorView::auxiliaryDataChanged(const ModelNode &node, const PropertyN
if (isInvisible)
newNode.deselectNode();
}
} else if (item.isFlowTransition() || item.isFlowItem() || item.isFlowActionArea()) {
} else if (item.isFlowTransition() || item.isFlowActionArea()
|| item.isFlowDecision() || item.isFlowWildcard()) {
FormEditorItem *editorItem = m_scene->itemForQmlItemNode(item);
if (editorItem)
editorItem->update();
} else if (item.isFlowView() || item.isFlowItem()) {
scene()->update();
} else if (name == "annotation" || name == "customId") {
if (FormEditorItem *editorItem = scene()->itemForQmlItemNode(item)) {
editorItem->update();

View File

@@ -347,6 +347,15 @@ void PropertyEditorContextObject::setStateName(const QString &newStateName)
emit stateNameChanged();
}
void PropertyEditorContextObject::setAllStateNames(const QStringList &allStates)
{
if (allStates == m_allStateNames)
return;
m_allStateNames = allStates;
emit allStateNamesChanged();
}
void PropertyEditorContextObject::setIsBaseState(bool newIsBaseState)
{
if (newIsBaseState == m_isBaseState)

View File

@@ -46,6 +46,7 @@ class PropertyEditorContextObject : public QObject
Q_PROPERTY(QString specificQmlData READ specificQmlData WRITE setSpecificQmlData NOTIFY specificQmlDataChanged)
Q_PROPERTY(QString stateName READ stateName WRITE setStateName NOTIFY stateNameChanged)
Q_PROPERTY(QStringList allStateNames READ allStateNames WRITE setAllStateNames NOTIFY allStateNamesChanged)
Q_PROPERTY(bool isBaseState READ isBaseState WRITE setIsBaseState NOTIFY isBaseStateChanged)
Q_PROPERTY(bool selectionChanged READ selectionChanged WRITE setSelectionChanged NOTIFY selectionChangedChanged)
@@ -70,6 +71,7 @@ public:
QUrl specificsUrl() const {return m_specificsUrl; }
QString specificQmlData() const {return m_specificQmlData; }
QString stateName() const {return m_stateName; }
QStringList allStateNames() const { return m_allStateNames; }
bool isBaseState() const { return m_isBaseState; }
bool selectionChanged() const { return m_selectionChanged; }
@@ -114,6 +116,7 @@ signals:
void specificsUrlChanged();
void specificQmlDataChanged();
void stateNameChanged();
void allStateNamesChanged();
void isBaseStateChanged();
void selectionChangedChanged();
void backendValuesChanged();
@@ -134,6 +137,8 @@ public slots:
void setStateName(const QString &newStateName);
void setAllStateNames(const QStringList &allStates);
void setIsBaseState(bool newIsBaseState);
void setSelectionChanged(bool newSelectionChanged);
@@ -151,6 +156,7 @@ private:
QString m_specificQmlData;
QString m_stateName;
QStringList m_allStateNames;
bool m_isBaseState;
bool m_selectionChanged;

View File

@@ -394,8 +394,13 @@ void PropertyEditorQmlBackend::setup(const QmlObjectNode &qmlObjectNode, const Q
contextObject()->setStateName(stateName);
if (!qmlObjectNode.isValid())
return;
context()->setContextProperty(QLatin1String("propertyCount"), QVariant(qmlObjectNode.modelNode().properties().count()));
QStringList stateNames = qmlObjectNode.allStateNames();
stateNames.prepend("base state");
contextObject()->setAllStateNames(stateNames);
contextObject()->setIsBaseState(qmlObjectNode.isInBaseState());
contextObject()->setHasAliasExport(qmlObjectNode.isAliasExported());

View File

@@ -212,6 +212,10 @@ void PropertyEditorView::changeValue(const QString &name)
}
}
bool forceReset = false;
if (name == "state" && castedValue.toString() == "base state")
castedValue = "";
if (castedValue.type() == QVariant::Color) {
QColor color = castedValue.value<QColor>();
QColor newColor = QColor(color.name());

View File

@@ -134,13 +134,17 @@ TimelineWidget::TimelineWidget(TimelineView *view)
sizePolicy1.setHeightForWidth(m_graphicsView->sizePolicy().hasHeightForWidth());
m_rulerView->setObjectName("RulerView");
m_rulerView->setScene(graphicsScene());
m_rulerView->setFixedHeight(TimelineConstants::rulerHeight);
m_rulerView->setAlignment(Qt::AlignLeft | Qt::AlignTop);
m_rulerView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_rulerView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_rulerView->viewport()->installEventFilter(new Eventfilter(this));
m_rulerView->viewport()->setFocusPolicy(Qt::NoFocus);
m_rulerView->setStyleSheet(css);
m_rulerView->setFrameShape(QFrame::NoFrame);
m_rulerView->setFrameShadow(QFrame::Plain);
m_rulerView->setLineWidth(0);
m_rulerView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_rulerView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_rulerView->setScene(graphicsScene());
m_graphicsView->setStyleSheet(css);
m_graphicsView->setObjectName("SceneView");

View File

@@ -50,6 +50,11 @@ public:
bool isList() const;
QList<ModelNode> resolveToModelNodeList() const;
void addModelNodeToArray(const ModelNode &modelNode);
void removeModelNodeFromArray(const ModelNode &modelNode);
static QList<BindingProperty> findAllReferencesTo(const ModelNode &modelNode);
static void deleteAllReferencesTo(const ModelNode &modelNode);
bool isAliasExport() const;

View File

@@ -90,6 +90,7 @@ public:
bool hasAnchors() const;
QString error() const;
bool hasError() const;
QStringList allStateNames() const;
protected:
void setProperty(const PropertyName &name, const QVariant &value);
@@ -117,6 +118,7 @@ protected:
InformationName setInformationAnchor(const PropertyName &sourceAnchorLine, const PropertyName &targetAnchorLine, qint32 targetInstanceId);
InformationName setInformationInstanceTypeForProperty(const PropertyName &property, const TypeName &type);
InformationName setInformationHasBindingForProperty(const PropertyName &property, bool hasProperty);
InformationName setAllStates(const QStringList &states);
void setParentId(qint32 instanceId);
void setRenderPixmap(const QImage &image);

View File

@@ -132,6 +132,21 @@ public:
class QmlFlowItemNode;
class QmlFlowViewNode;
class QMLDESIGNERCORE_EXPORT QmlFlowTargetNode : public QmlItemNode
{
public:
QmlFlowTargetNode(const ModelNode &modelNode) : QmlItemNode(modelNode) {}
bool isValid() const override;
void assignTargetItem(const QmlFlowTargetNode &node);
void destroyTargets();
ModelNode targetTransition() const;
QmlFlowViewNode flowView() const;
ModelNode findSourceForDecisionNode() const;
static bool isFlowEditorTarget(const ModelNode &modelNode);
void removeTransitions();
};
class QMLDESIGNERCORE_EXPORT QmlFlowActionAreaNode : public QmlItemNode
{
public:
@@ -139,7 +154,7 @@ public:
bool isValid() const override;
static bool isValidQmlFlowActionAreaNode(const ModelNode &modelNode);
ModelNode targetTransition() const;
void assignTargetFlowItem(const QmlFlowItemNode &flowItem);
void assignTargetFlowItem(const QmlFlowTargetNode &flowItem);
QmlFlowItemNode flowItemParent() const;
void destroyTarget();
ModelNode decisionNodeForTransition(const ModelNode &transition) const;
@@ -162,9 +177,13 @@ public:
bool isValid() const override;
static bool isValidQmlFlowViewNode(const ModelNode &modelNode);
QList<QmlFlowItemNode> flowItems() const;
ModelNode addTransition(const QmlFlowItemNode &from, const QmlFlowItemNode &to);
ModelNode addTransition(const QmlFlowTargetNode &from, const QmlFlowTargetNode &to);
const QList<ModelNode> transitions() const;
const QList<ModelNode> wildcards() const;
const QList<ModelNode> decicions() const;
QList<ModelNode> transitionsForTarget(const ModelNode &modelNode);
void removeDanglingTransitions();
void removeAllTransitions();
};

View File

@@ -120,6 +120,8 @@ public:
static QString generateTranslatableText(const QString& text);
QString simplifiedTypeName() const;
QStringList allStateNames() const;
protected:
NodeInstance nodeInstance() const;
QmlObjectNode nodeForInstance(const NodeInstance &instance) const;

View File

@@ -76,6 +76,7 @@ public:
QString errorMessage;
QHash<PropertyName, QPair<PropertyName, qint32> > anchors;
QStringList allStates;
};
NodeInstance::NodeInstance() = default;
@@ -169,6 +170,10 @@ bool NodeInstance::hasError() const
return !d->errorMessage.isEmpty();
}
QStringList NodeInstance::allStateNames() const
{
return d->allStates;
}
bool NodeInstance::isValid() const
{
@@ -592,6 +597,16 @@ InformationName NodeInstance::setInformationHasBindingForProperty(const Property
return NoInformationChange;
}
InformationName NodeInstance::setAllStates(const QStringList &states)
{
if (d->allStates != states) {
d->allStates = states;
return AllStates;
}
return NoInformationChange;
}
InformationName NodeInstance::setInformation(InformationName name, const QVariant &information, const QVariant &secondInformation, const QVariant &thirdInformation)
{
switch (name) {
@@ -614,6 +629,7 @@ InformationName NodeInstance::setInformation(InformationName name, const QVarian
case Anchor: return setInformationAnchor(information.toByteArray(), secondInformation.toByteArray(), thirdInformation.value<qint32>());
case InstanceTypeForProperty: return setInformationInstanceTypeForProperty(information.toByteArray(), secondInformation.toByteArray());
case HasBindingForProperty: return setInformationHasBindingForProperty(information.toByteArray(), secondInformation.toBool());
case AllStates: return setAllStates(information.toStringList());
case NoName:
default: break;
}

View File

@@ -210,10 +210,7 @@ void BindingProperty::addModelNodeToArray(const ModelNode &modelNode)
QString string = expression();
string.chop(1);
string.remove(0, 1);
QStringList simplifiedList = commaSeparatedSimplifiedStringList(string);
ModelNode node = modelNode;
simplifiedList.append(node.validId());
setExpression('[' + simplifiedList.join(',') + ']');
simplifiedList = commaSeparatedSimplifiedStringList(string);
} else {
ModelNode currentNode = resolveToModelNode();
if (currentNode.isValid())
@@ -231,6 +228,55 @@ void BindingProperty::addModelNodeToArray(const ModelNode &modelNode)
}
void BindingProperty::removeModelNodeFromArray(const ModelNode &modelNode)
{
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
if (!isBindingProperty())
throw InvalidArgumentException(__LINE__, __FUNCTION__, __FILE__, name());
if (isList() && modelNode.hasId()) {
QString string = expression();
string.chop(1);
string.remove(0, 1);
QStringList simplifiedList = commaSeparatedSimplifiedStringList(string);
if (simplifiedList.contains(modelNode.id())) {
simplifiedList.removeAll(modelNode.id());
if (simplifiedList.isEmpty())
parentModelNode().removeProperty(name());
else
setExpression('[' + simplifiedList.join(',') + ']');
}
}
}
QList<BindingProperty> BindingProperty::findAllReferencesTo(const ModelNode &modelNode)
{
if (!modelNode.isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
QList<BindingProperty> list;
for (const ModelNode &bindingNode : modelNode.view()->allModelNodes()) {
for (const BindingProperty &bindingProperty : bindingNode.bindingProperties())
if (bindingProperty.resolveToModelNode() == modelNode)
list.append(bindingProperty);
else if (bindingProperty.resolveToModelNodeList().contains(modelNode))
list.append(bindingProperty);
}
return list;
}
void BindingProperty::deleteAllReferencesTo(const ModelNode &modelNode)
{
for (BindingProperty &bindingProperty : findAllReferencesTo(modelNode)) {
if (bindingProperty.isList())
bindingProperty.removeModelNodeFromArray(modelNode);
else
bindingProperty.parentModelNode().removeProperty(bindingProperty.name());
}
}
bool BindingProperty::isAliasExport() const
{
if (!isValid())

View File

@@ -577,7 +577,7 @@ ModelNode QmlFlowActionAreaNode::targetTransition() const
return modelNode().bindingProperty("target").resolveToModelNode();
}
void QmlFlowActionAreaNode::assignTargetFlowItem(const QmlFlowItemNode &flowItem)
void QmlFlowActionAreaNode::assignTargetFlowItem(const QmlFlowTargetNode &flowItem)
{
QTC_ASSERT(isValid(), return);
QTC_ASSERT(flowItem.isValid(), return);
@@ -592,7 +592,8 @@ void QmlFlowActionAreaNode::assignTargetFlowItem(const QmlFlowItemNode &flowItem
destroyTarget();
ModelNode transition = flowView.addTransition(flowParent, flowItem);
ModelNode transition = flowView.addTransition(flowParent.modelNode(),
flowItem.modelNode());
modelNode().bindingProperty("target").setExpression(transition.validId());
}
@@ -625,6 +626,14 @@ ModelNode QmlFlowActionAreaNode::decisionNodeForTransition(const ModelNode &tran
&& finalTarget.bindingProperty("targets").resolveToModelNodeList().contains(transition))
return finalTarget;
}
QmlFlowViewNode flowView(view()->rootModelNode());
if (flowView.isValid()) {
for (const ModelNode target : flowView.decicions()) {
if (target.hasBindingProperty("targets")
&& target.bindingProperty("targets").resolveToModelNodeList().contains(transition))
return target;
}
}
}
return {};
@@ -645,22 +654,25 @@ QList<QmlFlowItemNode> QmlFlowViewNode::flowItems() const
{
QList<QmlFlowItemNode> list;
for (const ModelNode &node : allDirectSubModelNodes())
if (QmlFlowItemNode::isValidQmlFlowItemNode(node))
if (QmlFlowItemNode::isValidQmlFlowItemNode(node)
|| QmlVisualNode::isFlowDecision(node)
|| QmlVisualNode::isFlowWildcard(node))
list.append(node);
return list;
}
ModelNode QmlFlowViewNode::addTransition(const QmlFlowItemNode &from, const QmlFlowItemNode &to)
ModelNode QmlFlowViewNode::addTransition(const QmlFlowTargetNode &from, const QmlFlowTargetNode &to)
{
ModelNode transition = from.view()->createModelNode("FlowView.FlowTransition", 1, 0);
ModelNode transition = view()->createModelNode("FlowView.FlowTransition", 1, 0);
from.flowView().modelNode().nodeListProperty("flowTransitions").reparentHere(transition);
nodeListProperty("flowTransitions").reparentHere(transition);
QmlFlowItemNode f = from;
QmlFlowItemNode t = to;
QmlFlowTargetNode f = from;
QmlFlowTargetNode t = to;
transition.bindingProperty("from").setExpression(f.validId());
if (f.isValid())
transition.bindingProperty("from").setExpression(f.validId());
transition.bindingProperty("to").setExpression(t.validId());
return transition;
@@ -684,4 +696,138 @@ const QList<ModelNode> QmlFlowViewNode::wildcards() const
return {};
}
const QList<ModelNode> QmlFlowViewNode::decicions() const
{
if (modelNode().nodeListProperty("flowDecisions").isValid())
return modelNode().nodeListProperty("flowDecisions").toModelNodeList();
return {};
}
QList<ModelNode> QmlFlowViewNode::transitionsForTarget(const ModelNode &modelNode)
{
QList<ModelNode> list;
for (const ModelNode &transition : transitions()) {
if (transition.hasBindingProperty("to")
&& transition.bindingProperty("to").resolveToModelNode() == modelNode)
list.append(transition);
}
return list;
}
void QmlFlowViewNode::removeDanglingTransitions()
{
for (const ModelNode &transition : transitions()) {
if (!transition.hasBindingProperty("to"))
QmlObjectNode(transition).destroy();
}
}
bool QmlFlowTargetNode::isValid() const
{
return isFlowEditorTarget(modelNode());
}
void QmlFlowTargetNode::assignTargetItem(const QmlFlowTargetNode &node)
{
if (QmlFlowActionAreaNode::isValidQmlFlowActionAreaNode(modelNode())) {
QmlFlowActionAreaNode(modelNode()).assignTargetFlowItem(node);
} else if (isFlowWildcard()) {
destroyTargets();
ModelNode transition = flowView().addTransition(ModelNode(),
node);
modelNode().bindingProperty("target").setExpression(transition.validId());
} else if (isFlowDecision()) {
ModelNode sourceNode = modelNode();
if (QmlVisualNode::isFlowDecision(sourceNode))
sourceNode = findSourceForDecisionNode();
if (sourceNode.isValid()) {
ModelNode transition = flowView().addTransition(sourceNode,
node);
modelNode().bindingProperty("targets").addModelNodeToArray(transition);
}
}
}
void QmlFlowTargetNode::destroyTargets()
{
QTC_ASSERT(isValid(), return);
if (targetTransition().isValid()) {
QmlObjectNode(targetTransition()).destroy();
modelNode().removeProperty("target");
}
if (hasBindingProperty("targets")) {
for (ModelNode &node : modelNode().bindingProperty("targets").resolveToModelNodeList()) {
QmlObjectNode(node).destroy();
}
modelNode().removeProperty("targets");
}
}
ModelNode QmlFlowTargetNode::targetTransition() const
{
if (!modelNode().hasBindingProperty("target"))
return {};
return modelNode().bindingProperty("target").resolveToModelNode();
}
QmlFlowViewNode QmlFlowTargetNode::flowView() const
{
return view()->rootModelNode();
}
ModelNode QmlFlowTargetNode::findSourceForDecisionNode() const
{
if (!isFlowDecision())
return {};
for (const ModelNode transition : flowView().transitionsForTarget(modelNode())) {
if (transition.hasBindingProperty("from")) {
const ModelNode source = transition.bindingProperty("from").resolveToModelNode();
if (source.isValid()) {
if (QmlVisualNode::isFlowDecision(source))
return QmlFlowTargetNode(source).findSourceForDecisionNode();
else if (QmlItemNode(source).isFlowItem())
return source;
}
}
}
return {};
}
bool QmlFlowTargetNode::isFlowEditorTarget(const ModelNode &modelNode)
{
return QmlItemNode(modelNode).isFlowItem()
|| QmlItemNode(modelNode).isFlowActionArea()
|| QmlVisualNode::isFlowDecision(modelNode)
|| QmlVisualNode::isFlowWildcard(modelNode);
}
void QmlFlowTargetNode::removeTransitions()
{
if (!modelNode().hasId())
return;
for (const BindingProperty &property : BindingProperty::findAllReferencesTo(modelNode())) {
if (property.isValid() && QmlVisualNode::isFlowTransition(property.parentModelNode()))
QmlObjectNode(property.parentModelNode()).destroy();
}
}
void QmlFlowViewNode::removeAllTransitions()
{
if (!isValid())
return;
if (hasProperty("flowTransitions"))
removeProperty("flowTransitions");
}
} //QmlDesigner

View File

@@ -719,4 +719,9 @@ QString QmlObjectNode::simplifiedTypeName() const
return modelNode().simplifiedTypeName();
}
QStringList QmlObjectNode::allStateNames() const
{
return nodeInstance().allStateNames();
}
} //QmlDesigner

View File

@@ -2033,6 +2033,9 @@ FilePaths BaseQtVersionPrivate::qtCorePaths()
else if (file.endsWith(".dll")
|| file.endsWith(QString::fromLatin1(".so.") + versionString)
|| file.endsWith(".so")
#if defined(Q_OS_OPENBSD)
|| file.contains(QRegularExpression("\\.so\\.[0-9]+\\.[0-9]+$")) // QTCREATORBUG-23818
#endif
|| file.endsWith(QLatin1Char('.') + versionString + ".dylib"))
dynamicLibs.append(FilePath::fromFileInfo(info));
}

View File

@@ -163,10 +163,13 @@ void BaseHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPoi
auto layout = new QVBoxLayout;
layout->setContentsMargins(0, 0, 0, 0);
auto label = new QLabel;
label->setObjectName("qcWidgetTipTopLabel");
label->setTextFormat(m_textFormat);
label->setText(m_toolTip);
layout->addWidget(label);
layout->addWidget(new QLabel("<hr/>" + helpContents));
auto helpContentLabel = new QLabel("<hr/>" + helpContents);
helpContentLabel->setObjectName("qcWidgetTipHelpLabel");
layout->addWidget(helpContentLabel);
Utils::ToolTip::show(point, layout, editorWidget, helpItem);
}
}

View File

@@ -4715,14 +4715,19 @@ void tst_Dumpers::dumper_data()
QTest::newRow("StdUniquePtr")
<< Data("#include <memory>\n"
"#include <string>\n" + fooData,
"#include <string>\n" + fooData +
"static Foo *alloc_foo() { return new Foo; }\n"
"static void free_foo(Foo *f) { delete f; }\n",
"std::unique_ptr<int> p0;\n\n"
"std::unique_ptr<int> p1(new int(32));\n\n"
"std::unique_ptr<Foo> p2(new Foo);\n\n"
"std::unique_ptr<std::string> p3(new std::string(\"ABC\"));",
"std::unique_ptr<std::string> p3(new std::string(\"ABC\"));\n"
"&p0, &p1, &p2, &p3")
"std::unique_ptr<Foo, void(*)(Foo*)> p4{alloc_foo(), free_foo};",
"&p0, &p1, &p2, &p3, &p4")
+ CoreProfile()
+ Cxx11Profile()
@@ -4731,7 +4736,8 @@ void tst_Dumpers::dumper_data()
+ Check("p0", "(null)", "std::unique_ptr<int, std::default_delete<int> >")
+ Check("p1", "32", "std::unique_ptr<int, std::default_delete<int> >")
+ Check("p2", Pointer(), "std::unique_ptr<Foo, std::default_delete<Foo> >")
+ Check("p3", "\"ABC\"", "std::unique_ptr<std::string, std::default_delete<std::string> >");
+ Check("p3", "\"ABC\"", "std::unique_ptr<std::string, std::default_delete<std::string> >")
+ Check("p4.b", "2", "int");
QTest::newRow("StdOnce")

View File

@@ -159,8 +159,8 @@ def verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, e
elif expectedType == "TextTip":
__handleTextTips__(tip, expectedVals, altVal)
elif expectedType == "WidgetTip":
test.warning("Sorry - WidgetTip checks aren't implemented yet.")
sendEvent("QMouseEvent", editor, QEvent.MouseMove, 0, -50, Qt.NoButton, 0)
__handleWidgetTips__(tip, expectedVals)
sendEvent("QMouseEvent", editor, QEvent.MouseMove, 0, 0, Qt.NoButton, 0)
waitFor("isNull(tip)", 10000)
# helper function that handles verification of TextTip hoverings
@@ -228,6 +228,19 @@ def __handleColorTips__(colTip, expectedColor, alternativeColor):
test.fail("ColorTip does not match - expected color '%X'%s got '%X'"
% (uint(cmp.rgb()), altColorText, uint(rgb.rgb())))
# helper function that handles verification of WidgetTip hoverings
# param widgetTip the WidgetTip object
# param expectedVals a dict holding property value pairs that must match
def __handleWidgetTips__(widgetTip, expectedVals):
toplabel = waitForObject("{type='QLabel' objectName='qcWidgetTipTopLabel' visible='1'}")
foundText = str(toplabel.text)
try:
helplabel = waitForObject("{type='QLabel' objectName='qcWidgetTipHelpLabel' visible='1'}", 1000)
foundText += str(helplabel.text)
except:
pass
test.compare(foundText, expectedVals["text"])
# function that checks whether all expected properties (including their values)
# match the given properties
# param properties a dict holding the properties to check

View File

@@ -122,35 +122,26 @@ def testHovering():
else:
home = "<Home>"
additionalKeyPresses = [home, "<Right>"]
expectedTypes = ["TextTip", "TextTip"]
expectedTypes = ["WidgetTip", "WidgetTip"]
expectedValues = [
{'text':'<table><tr><td valign=middle><p>FocusScope</p><hr/><p>\n<p>Explicitly '
'creates a focus scope </p></p></td><td>&nbsp;&nbsp;<img src=":/utils/tooltip/images/f1.png"></td></tr></table>'},
{'text':'<table><tr><td valign=middle><p>Rectangle</p><hr/><p>\n<p>Paints a filled rectangle with an '
'optional border </p></p></td><td>&nbsp;&nbsp;<img src=":/utils/tooltip/images/f1.png"></td></tr></table>'}
{'text':'FocusScope<hr/>\n<p>Explicitly creates a focus scope.</p>'},
{'text':'Rectangle<hr/>\n<p>Paints a filled rectangle with an optional border.</p>'}
]
alternativeValues = [{"text":"<p>FocusScope</p>"}, {"text":"<p>Rectangle</p>"}]
verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues)
verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues)
test.log("Testing hovering properties")
openDocument(focusDocumentPath % "focus\\.qml")
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
lines = ['focus:\s*true', 'color:\s*"black"', 'states:\s*State\s*\{', 'transitions:\s*Transition\s*\{']
expectedTypes = ["TextTip", "TextTip", "TextTip", "TextTip"]
expectedTypes = ["TextTip", "WidgetTip", "WidgetTip", "WidgetTip"]
expectedValues = [
{'text':'<table><tr><td valign=middle><p>boolean</p><hr/><p><p>This property indicates whether the item has focus '
'within the enclosing focus scope. If true, this item will gain active focus when the enclosing '
'focus scope gains active focus. In the following example, <tt>input</tt> will be given active focus '
'when <tt>scope</tt> gains active focus.</p></p></td><td>&nbsp;&nbsp;<img src=":/utils/tooltip/images/f1.png"'
'></td></tr></table>'},
{'text':'<table><tr><td valign=middle><p>string</p><hr/><p><p>This property holds the color used to fill the rectangle.'
'</p></p></td><td>&nbsp;&nbsp;<img src=":/utils/tooltip/images/f1.png"></td></tr></table>'},
{'text':'<table><tr><td valign=middle><p>State</p><hr/><p><p>This property holds the list of possible states for this item. '
'To change the state of this item, set the state property to one of these states, or set the state property '
'to an empty string to revert the item to its default state.'
'</p></p></td><td>&nbsp;&nbsp;<img src=":/utils/tooltip/images/f1.png"></td></tr></table>'},
{'text':'<table><tr><td valign=middle><p>Transition</p><hr/><p><p>This property holds the list of transitions for this item. '
'These define the transitions to be applied to the item whenever it changes its state.'
'</p></p></td><td>&nbsp;&nbsp;<img src=":/utils/tooltip/images/f1.png"></td></tr></table>'}
{'text':'string'},
{'text':'State'},
{'text':'Transition'}
]
alternativeValues = [{"text":"<p>boolean</p>"}, {"text":"<p>string</p>"},
{"text":"<p>State</p>"}, {"text":"<p>Transition</p>"}]