diff --git a/doc/qtcreator/images/qmldesigner-visual-editor.png b/doc/qtcreator/images/qmldesigner-visual-editor.png deleted file mode 100644 index 92683ad0240..00000000000 Binary files a/doc/qtcreator/images/qmldesigner-visual-editor.png and /dev/null differ diff --git a/doc/qtcreator/images/qtcreator-build-dependencies.png b/doc/qtcreator/images/qtcreator-build-dependencies.png index b67341f94fa..896a6a7f2ad 100644 Binary files a/doc/qtcreator/images/qtcreator-build-dependencies.png and b/doc/qtcreator/images/qtcreator-build-dependencies.png differ diff --git a/doc/qtcreator/images/qtcreator-code-style-clang-format.png b/doc/qtcreator/images/qtcreator-code-style-clang-format.png index d803d551a16..8ecce2a9608 100644 Binary files a/doc/qtcreator/images/qtcreator-code-style-clang-format.png and b/doc/qtcreator/images/qtcreator-code-style-clang-format.png differ diff --git a/doc/qtcreator/images/qtcreator-code-style-settings-edit-cpp.png b/doc/qtcreator/images/qtcreator-code-style-settings-edit-cpp.png index ff52a41b8f3..fccc6b6b849 100644 Binary files a/doc/qtcreator/images/qtcreator-code-style-settings-edit-cpp.png and b/doc/qtcreator/images/qtcreator-code-style-settings-edit-cpp.png differ diff --git a/doc/qtcreator/images/qtcreator-code-style-settings-edit-qtquick.png b/doc/qtcreator/images/qtcreator-code-style-settings-edit-qtquick.png index 276ce1cbab0..17dbf6bda25 100644 Binary files a/doc/qtcreator/images/qtcreator-code-style-settings-edit-qtquick.png and b/doc/qtcreator/images/qtcreator-code-style-settings-edit-qtquick.png differ diff --git a/doc/qtcreator/images/qtcreator-editor-settings.png b/doc/qtcreator/images/qtcreator-editor-settings.png index 81b4af6a395..0c5265a6a2f 100644 Binary files a/doc/qtcreator/images/qtcreator-editor-settings.png and b/doc/qtcreator/images/qtcreator-editor-settings.png differ diff --git a/doc/qtcreator/images/qtcreator-options-build-run-debuggers.png b/doc/qtcreator/images/qtcreator-options-build-run-debuggers.png index f6a56fbe4fd..d4cac7e190a 100644 Binary files a/doc/qtcreator/images/qtcreator-options-build-run-debuggers.png and b/doc/qtcreator/images/qtcreator-options-build-run-debuggers.png differ diff --git a/doc/qtcreator/images/qtcreator-projects-code-style.png b/doc/qtcreator/images/qtcreator-projects-code-style.png index 90fb3b4fcd6..6063a2c211d 100644 Binary files a/doc/qtcreator/images/qtcreator-projects-code-style.png and b/doc/qtcreator/images/qtcreator-projects-code-style.png differ diff --git a/doc/qtcreator/images/qtcreator-session-manager.png b/doc/qtcreator/images/qtcreator-session-manager.png index 65e057f64b1..22feaaf4117 100644 Binary files a/doc/qtcreator/images/qtcreator-session-manager.png and b/doc/qtcreator/images/qtcreator-session-manager.png differ diff --git a/doc/qtcreator/images/qtcreator-welcome-session.png b/doc/qtcreator/images/qtcreator-welcome-session.png index e5590826152..8d2795df0fb 100644 Binary files a/doc/qtcreator/images/qtcreator-welcome-session.png and b/doc/qtcreator/images/qtcreator-welcome-session.png differ diff --git a/doc/qtcreator/images/studio-timeline.png b/doc/qtcreator/images/studio-timeline.png index e5743e068bd..49557eeaaed 100644 Binary files a/doc/qtcreator/images/studio-timeline.png and b/doc/qtcreator/images/studio-timeline.png differ diff --git a/doc/qtcreator/src/editors/creator-coding-edit-mode.qdoc b/doc/qtcreator/src/editors/creator-coding-edit-mode.qdoc index bd5d5e2b565..56be275326d 100644 --- a/doc/qtcreator/src/editors/creator-coding-edit-mode.qdoc +++ b/doc/qtcreator/src/editors/creator-coding-edit-mode.qdoc @@ -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 diff --git a/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc b/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc index 19dae2d72ed..7aac8fc0a95 100644 --- a/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc +++ b/doc/qtcreator/src/howto/creator-only/qtcreator-faq.qdoc @@ -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{} is the amount of cores in your CPU: \c{-j } diff --git a/doc/qtcreator/src/overview/creator-only/creator-deployment-overview.qdoc b/doc/qtcreator/src/overview/creator-only/creator-deployment-overview.qdoc index 73355915804..a8216d313e3 100644 --- a/doc/qtcreator/src/overview/creator-only/creator-deployment-overview.qdoc +++ b/doc/qtcreator/src/overview/creator-only/creator-deployment-overview.qdoc @@ -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 diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc index a2f8c374807..5f8d6c6fb1f 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-editor.qdoc @@ -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} diff --git a/doc/qtcreator/src/projects/creator-projects-running.qdoc b/doc/qtcreator/src/projects/creator-projects-running.qdoc index 85cb0b287c1..b8cb227527a 100644 --- a/doc/qtcreator/src/projects/creator-projects-running.qdoc +++ b/doc/qtcreator/src/projects/creator-projects-running.qdoc @@ -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: diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 0c63e395821..5d20bc7c335 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -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 diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-app-development.qdoc b/doc/qtcreator/src/qtquick/creator-only/qtquick-app-development.qdoc index 16468889570..f416d1bfa2d 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-app-development.qdoc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-app-development.qdoc @@ -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} diff --git a/doc/qtcreator/src/qtquick/qtquick-annotations.qdoc b/doc/qtcreator/src/qtquick/qtquick-annotations.qdoc index cd8ada49258..0c982d6548b 100644 --- a/doc/qtcreator/src/qtquick/qtquick-annotations.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-annotations.qdoc @@ -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. diff --git a/doc/qtcreator/src/qtquick/qtquick-buttons.qdoc b/doc/qtcreator/src/qtquick/qtquick-buttons.qdoc index 68e2aaadb81..b9f4bf2ff69 100644 --- a/doc/qtcreator/src/qtquick/qtquick-buttons.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-buttons.qdoc @@ -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 diff --git a/doc/qtcreator/src/qtquick/qtquick-components.qdoc b/doc/qtcreator/src/qtquick/qtquick-components.qdoc index f2e3f922a11..4266a4d7d0c 100644 --- a/doc/qtcreator/src/qtquick/qtquick-components.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-components.qdoc @@ -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} diff --git a/doc/qtcreator/src/qtquick/qtquick-designer.qdoc b/doc/qtcreator/src/qtquick/qtquick-designer.qdoc index 50e01b83079..e47d39dee49 100644 --- a/doc/qtcreator/src/qtquick/qtquick-designer.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-designer.qdoc @@ -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}. */ diff --git a/doc/qtcreator/src/qtquick/qtquick-form-editor.qdoc b/doc/qtcreator/src/qtquick/qtquick-form-editor.qdoc new file mode 100644 index 00000000000..37a31cc4be9 --- /dev/null +++ b/doc/qtcreator/src/qtquick/qtquick-form-editor.qdoc @@ -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. + +*/ diff --git a/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc b/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc index 7b8066e4a31..ad6f61b4d0f 100644 --- a/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-live-preview-desktop.qdoc @@ -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. diff --git a/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc b/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc index 1f63e470bcf..1fae55bb9a4 100644 --- a/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc @@ -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. diff --git a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc index a578d73c32a..b5b7d372e0f 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc @@ -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 diff --git a/share/qtcreator/debugger/stdtypes.py b/share/qtcreator/debugger/stdtypes.py index c6693f70b69..b08b9d603de 100644 --- a/share/qtcreator/debugger/stdtypes.py +++ b/share/qtcreator/debugger/stdtypes.py @@ -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) diff --git a/share/qtcreator/qml/qmlpuppet/interfaces/commondefines.h b/share/qtcreator/qml/qmlpuppet/interfaces/commondefines.h index eb1bd41051b..b5cf157a8cc 100644 --- a/share/qtcreator/qml/qmlpuppet/interfaces/commondefines.h +++ b/share/qtcreator/qml/qmlpuppet/interfaces/commondefines.h @@ -34,6 +34,7 @@ enum InformationName { NoName, NoInformationChange = NoName, + AllStates, Size, BoundingRect, Transform, diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp index cfdc513c1b1..813057e10b5 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/nodeinstanceserver.cpp @@ -1061,6 +1061,7 @@ static QVector createInformationVector(const QList QuickItemNodeInstance::allItemsRecursive() const return itemList; } +QStringList QuickItemNodeInstance::allStates() const +{ + QStringList list; + + QList 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; diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.h index 8aab24178be..f42e45a8ff5 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.h @@ -96,6 +96,7 @@ public: void doComponentComplete() override; QList allItemsRecursive() const override; + QStringList allStates() const override; protected: explicit QuickItemNodeInstance(QQuickItem*); diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp index 395b56e2416..0c9f5721a58 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.cpp @@ -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::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; diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h index c85ba9a2b85..ceb3b1e5b14 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/servernodeinstance.h @@ -164,6 +164,7 @@ public: QSharedPointer internalInstance() const; QList stateInstances() const; + QStringList allStates() const; static bool isSubclassOf(QObject *object, const QByteArray &superTypeName); diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ColumnSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ColumnSpecifics.qml index fb5dcdbc40c..a613c7c28fd 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ColumnSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ColumnSpecifics.qml @@ -52,5 +52,8 @@ Column { } } } + + PaddingSection { + } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/FlowSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/FlowSpecifics.qml index 634880dc2bb..dcee9576650 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/FlowSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/FlowSpecifics.qml @@ -83,4 +83,7 @@ Column { } } } + + PaddingSection { + } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/GridSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/GridSpecifics.qml index 70da3f96960..37be5e57701 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/GridSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/GridSpecifics.qml @@ -115,4 +115,7 @@ Column { } } } + + PaddingSection { + } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml index 18bbb84f61b..b6b3dfae2a4 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/RowSpecifics.qml @@ -67,4 +67,7 @@ Column { } } } + + PaddingSection { + } } diff --git a/src/libs/advanceddockingsystem/dockmanager.cpp b/src/libs/advanceddockingsystem/dockmanager.cpp index 0a621c2c660..051fa68a406 100644 --- a/src/libs/advanceddockingsystem/dockmanager.cpp +++ b/src/libs/advanceddockingsystem/dockmanager.cpp @@ -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; diff --git a/src/libs/utils/tooltip/tooltip.cpp b/src/libs/utils/tooltip/tooltip.cpp index 2546ae52177..2885f53ed7f 100644 --- a/src/libs/utils/tooltip/tooltip.cpp +++ b/src/libs/utils/tooltip/tooltip.cpp @@ -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); diff --git a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp index 1505dffa1a7..7b498ab957d 100644 --- a/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp +++ b/src/plugins/compilationdatabaseprojectmanager/compilationdbparser.cpp @@ -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; } diff --git a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp index 3687ba362d2..42f95952db1 100644 --- a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp +++ b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp @@ -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) diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp index c0f53f4946a..2c239a8aa94 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp @@ -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); }); } } diff --git a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp index 650892339a0..58b47351f98 100644 --- a/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp +++ b/src/plugins/qmldesigner/components/formeditor/formeditorview.cpp @@ -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(); diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp index 0bf0503888f..8be49060e64 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp @@ -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) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h index 4b74f7331bc..9e3309ee351 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h @@ -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; diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index 56202a2596b..d9a685c7032 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -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()); diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp index 1f2440b56f0..5307bf522b3 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp @@ -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 newColor = QColor(color.name()); diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp index 85a68cd0bd0..098fe766a02 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinewidget.cpp @@ -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"); diff --git a/src/plugins/qmldesigner/designercore/include/bindingproperty.h b/src/plugins/qmldesigner/designercore/include/bindingproperty.h index b8f60efbd87..cea09aeb195 100644 --- a/src/plugins/qmldesigner/designercore/include/bindingproperty.h +++ b/src/plugins/qmldesigner/designercore/include/bindingproperty.h @@ -50,6 +50,11 @@ public: bool isList() const; QList resolveToModelNodeList() const; void addModelNodeToArray(const ModelNode &modelNode); + void removeModelNodeFromArray(const ModelNode &modelNode); + + static QList findAllReferencesTo(const ModelNode &modelNode); + static void deleteAllReferencesTo(const ModelNode &modelNode); + bool isAliasExport() const; diff --git a/src/plugins/qmldesigner/designercore/include/nodeinstance.h b/src/plugins/qmldesigner/designercore/include/nodeinstance.h index 9595396ae9c..56b8141bde6 100644 --- a/src/plugins/qmldesigner/designercore/include/nodeinstance.h +++ b/src/plugins/qmldesigner/designercore/include/nodeinstance.h @@ -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); diff --git a/src/plugins/qmldesigner/designercore/include/qmlitemnode.h b/src/plugins/qmldesigner/designercore/include/qmlitemnode.h index 890d7deb3b5..ef8f1b28ba2 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlitemnode.h +++ b/src/plugins/qmldesigner/designercore/include/qmlitemnode.h @@ -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 flowItems() const; - ModelNode addTransition(const QmlFlowItemNode &from, const QmlFlowItemNode &to); + ModelNode addTransition(const QmlFlowTargetNode &from, const QmlFlowTargetNode &to); const QList transitions() const; const QList wildcards() const; + const QList decicions() const; + QList transitionsForTarget(const ModelNode &modelNode); + void removeDanglingTransitions(); + void removeAllTransitions(); }; diff --git a/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h b/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h index 02e447aa8be..48b7c1ac007 100644 --- a/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h +++ b/src/plugins/qmldesigner/designercore/include/qmlobjectnode.h @@ -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; diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstance.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstance.cpp index 15d09e45169..453c1b31a47 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstance.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstance.cpp @@ -76,6 +76,7 @@ public: QString errorMessage; QHash > 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()); 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; } diff --git a/src/plugins/qmldesigner/designercore/model/bindingproperty.cpp b/src/plugins/qmldesigner/designercore/model/bindingproperty.cpp index 1f1c1df58fa..a6b332eb6e4 100644 --- a/src/plugins/qmldesigner/designercore/model/bindingproperty.cpp +++ b/src/plugins/qmldesigner/designercore/model/bindingproperty.cpp @@ -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::findAllReferencesTo(const ModelNode &modelNode) +{ + if (!modelNode.isValid()) + throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__); + + QList 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()) diff --git a/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp b/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp index 4ba478f93cf..098f8317a5d 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlitemnode.cpp @@ -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 QmlFlowViewNode::flowItems() const { QList 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 QmlFlowViewNode::wildcards() const return {}; } +const QList QmlFlowViewNode::decicions() const +{ + if (modelNode().nodeListProperty("flowDecisions").isValid()) + return modelNode().nodeListProperty("flowDecisions").toModelNodeList(); + + return {}; +} + +QList QmlFlowViewNode::transitionsForTarget(const ModelNode &modelNode) +{ + QList 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 diff --git a/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp b/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp index 07ee742c847..e811ca071ea 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlobjectnode.cpp @@ -719,4 +719,9 @@ QString QmlObjectNode::simplifiedTypeName() const return modelNode().simplifiedTypeName(); } +QStringList QmlObjectNode::allStateNames() const +{ + return nodeInstance().allStateNames(); +} + } //QmlDesigner diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 49dd128d28b..e6abb0ad881 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -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)); } diff --git a/src/plugins/texteditor/basehoverhandler.cpp b/src/plugins/texteditor/basehoverhandler.cpp index 8d7fcad5173..34eb326b812 100644 --- a/src/plugins/texteditor/basehoverhandler.cpp +++ b/src/plugins/texteditor/basehoverhandler.cpp @@ -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("
" + helpContents)); + auto helpContentLabel = new QLabel("
" + helpContents); + helpContentLabel->setObjectName("qcWidgetTipHelpLabel"); + layout->addWidget(helpContentLabel); Utils::ToolTip::show(point, layout, editorWidget, helpItem); } } diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 9c7d53415d1..f333f5068a5 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -4715,14 +4715,19 @@ void tst_Dumpers::dumper_data() QTest::newRow("StdUniquePtr") << Data("#include \n" - "#include \n" + fooData, + "#include \n" + fooData + + + "static Foo *alloc_foo() { return new Foo; }\n" + "static void free_foo(Foo *f) { delete f; }\n", "std::unique_ptr p0;\n\n" "std::unique_ptr p1(new int(32));\n\n" "std::unique_ptr p2(new Foo);\n\n" - "std::unique_ptr p3(new std::string(\"ABC\"));", + "std::unique_ptr p3(new std::string(\"ABC\"));\n" - "&p0, &p1, &p2, &p3") + "std::unique_ptr 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 >") + Check("p1", "32", "std::unique_ptr >") + Check("p2", Pointer(), "std::unique_ptr >") - + Check("p3", "\"ABC\"", "std::unique_ptr >"); + + Check("p3", "\"ABC\"", "std::unique_ptr >") + + Check("p4.b", "2", "int"); QTest::newRow("StdOnce") diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index 8410e986ef9..52430e70214 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -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 diff --git a/tests/system/suite_editors/tst_qml_editor/test.py b/tests/system/suite_editors/tst_qml_editor/test.py index ecd9ab008e6..c26207ea6ec 100644 --- a/tests/system/suite_editors/tst_qml_editor/test.py +++ b/tests/system/suite_editors/tst_qml_editor/test.py @@ -122,35 +122,26 @@ def testHovering(): else: home = "" additionalKeyPresses = [home, ""] - expectedTypes = ["TextTip", "TextTip"] + expectedTypes = ["WidgetTip", "WidgetTip"] expectedValues = [ - {'text':'

FocusScope


\n

Explicitly ' - 'creates a focus scope

  
'}, - {'text':'

Rectangle


\n

Paints a filled rectangle with an ' - 'optional border

  
'} + {'text':'FocusScope
\n

Explicitly creates a focus scope.

'}, + {'text':'Rectangle
\n

Paints a filled rectangle with an optional border.

'} ] - alternativeValues = [{"text":"

FocusScope

"}, {"text":"

Rectangle

"}] - 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':'

boolean


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, input will be given active focus ' 'when scope gains active focus.

  
'}, - {'text':'

string


This property holds the color used to fill the rectangle.' - '

  
'}, - {'text':'

State


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.' - '

  
'}, - {'text':'

Transition


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.' - '

  
'} + {'text':'string'}, + {'text':'State'}, + {'text':'Transition'} ] alternativeValues = [{"text":"

boolean

"}, {"text":"

string

"}, {"text":"

State

"}, {"text":"

Transition

"}]