diff --git a/CMakeLists.txt b/CMakeLists.txt index d1db97b13ca..2d1b2a39d3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,6 @@ set(CMAKE_CXX_EXTENSIONS OFF) option(WITH_TESTS "Build Tests" OFF) add_feature_info("Build tests" ${WITH_TESTS} "") option(WITH_DEBUG_CMAKE "Enabled CMake project debugging functionality (e.g. source file disk checking)" OFF) -option(BUILD_WITH_PCH "Build with precompiled headers" ON) # merge binary directories of sub projects into top level set(QTC_MERGE_BINARY_DIR ON) @@ -50,10 +49,15 @@ find_package(Qt5 ) if (Qt5_VERSION VERSION_LESS 6.0.0) install(TARGETS Qt6Core5Compat EXPORT QtCreator) + set(BUILD_WITH_PCH_DEFAULT ON) +else() + set(BUILD_WITH_PCH_DEFAULT OFF) endif() find_package(Qt5 COMPONENTS LinguistTools QUIET) find_package(Qt5 COMPONENTS Designer DesignerComponents Help SerialPort Svg Tools QUIET) +option(BUILD_WITH_PCH "Build with precompiled headers" ${BUILD_WITH_PCH_DEFAULT}) + find_package(Threads) find_package(Clang QUIET) find_package(KF5SyntaxHighlighting QUIET) diff --git a/cmake/QtCreatorIDEBranding.cmake b/cmake/QtCreatorIDEBranding.cmake index b507ecc284d..a4d0b1e7aea 100644 --- a/cmake/QtCreatorIDEBranding.cmake +++ b/cmake/QtCreatorIDEBranding.cmake @@ -1,7 +1,7 @@ set(IDE_VERSION "4.15.82") # The IDE version. set(IDE_VERSION_COMPAT "4.15.82") # The IDE Compatibility version. -set(IDE_VERSION_DISPLAY "4.16.0-beta1") # The IDE display version. -set(IDE_COPYRIGHT_YEAR "2020") # The IDE current copyright year. +set(IDE_VERSION_DISPLAY "4.16.0-beta1") # The IDE display version. +set(IDE_COPYRIGHT_YEAR "2021") # The IDE current copyright year. set(IDE_SETTINGSVARIANT "QtProject") # The IDE settings variation. set(IDE_COPY_SETTINGSVARIANT "Nokia") # The IDE settings to initially import. diff --git a/dist/changes-4.15.0.md b/dist/changes-4.15.0.md index 1ae6ebcdb4a..61d2974b133 100644 --- a/dist/changes-4.15.0.md +++ b/dist/changes-4.15.0.md @@ -44,6 +44,7 @@ Editing * Added type aliases to `C++ Classes, Enums and Functions` locator filter (QTCREATORBUG-5800) * Added parentheses highlighting for ternary operator (QTCREATORBUG-1410) +* Improved type name minimization for `Add definition` (QTCREATORBUG-8030) * Fixed type hierarchy with templates classes and typedefs * Fixed that `-include` compile option was ignored by code model (QTCREATORBUG-20602) @@ -73,12 +74,14 @@ Editing * Added support for inline components (QTCREATORBUG-24766, QTCREATORBUG-24705) * Fixed issues with multiple import paths (QTCREATORBUG-24405) * Fixed reformatting of arrow functions (QTCREATORBUG-25198) +* Fixed reformatting of JavaScript spread operator (QTCREATORBUG-23402) ### Language Client * Added support for new formatting options in LSP 3.15.0 * Added support for versioned diagnostics * Added support for server progress messages +* Improved Java language server support ### Java @@ -89,6 +92,8 @@ Projects -------- * Added `Open Terminal Here` for project nodes (QTCREATORBUG-25107) +* Added option for running application as root user (QTCREATORBUG-2831, + QTCREATORBUG-25330) ### qmake @@ -101,6 +106,11 @@ Projects * Added filesystem node to project tree (QTCREATORBUG-24677) * Added `install/strip` and `package` targets (QTCREATORBUG-22047, QTCREATORBUG-22620) +* Added automatic run of conan install on initial CMake call + (QTCREATORBUG-25362) +* Added batch editing for CMake configuration +* Made it possible to copy CMake variables from configuration + (QTCREATORBUG-24781) * Removed utility targets from CMake target locator filters (QTCREATORBUG-24718) * Fixed that configuration changes were lost when CMake configuration fails (QTCREATORBUG-24593) @@ -136,6 +146,10 @@ Debugging * Added option to copy selected items from stack view (QTCREATORBUG-24701) * Added visualization of hit breakpoint in `Breakpoints` view (QTCREATORBUG-6999) +* Fixed type display for automatically dereferenced pointers + (QTCREATORBUG-20907) +* Fixed that debugging repeatedly stopped with `SIGSTOP` (QTCREATORBUG-25073, + QTCREATORBUG-25082, QTCREATORBUG-25227) ### QML @@ -184,6 +198,7 @@ Platforms ### Remote Linux * Fixed issues with remote process PID parsing (QTCREATORBUG-25306) +* Fixed issues with `rsync` on Windows (QTCREATORBUG-25333) ### MCU diff --git a/doc/qtcreator/images/extraimages/images/V3Po15bNErw.jpg b/doc/qtcreator/images/extraimages/images/V3Po15bNErw.jpg new file mode 100644 index 00000000000..b3f27ff426e Binary files /dev/null and b/doc/qtcreator/images/extraimages/images/V3Po15bNErw.jpg differ diff --git a/doc/qtcreator/images/extraimages/qtcreator-extraimages.qdocconf b/doc/qtcreator/images/extraimages/qtcreator-extraimages.qdocconf index b689825fc30..5eacc4d3118 100644 --- a/doc/qtcreator/images/extraimages/qtcreator-extraimages.qdocconf +++ b/doc/qtcreator/images/extraimages/qtcreator-extraimages.qdocconf @@ -6,4 +6,5 @@ images/Ed8WS03C-Vk.jpg \ images/UfvA04CIXv0.jpg \ images/FzmLuRHQXaw.jpg \ - images/pEETxSxYazg.jpg + images/pEETxSxYazg.jpg \ + images/V3Po15bNErw.jpg diff --git a/doc/qtcreator/images/extraimages/qtdesignstudio-extraimages.qdocconf b/doc/qtcreator/images/extraimages/qtdesignstudio-extraimages.qdocconf index a09c5566a21..c0f64117d24 100644 --- a/doc/qtcreator/images/extraimages/qtdesignstudio-extraimages.qdocconf +++ b/doc/qtcreator/images/extraimages/qtdesignstudio-extraimages.qdocconf @@ -11,4 +11,5 @@ images/UfvA04CIXv0.jpg \ images/FzmLuRHQXaw.jpg \ images/w1yhDl93YI0.jpg \ - images/pEETxSxYazg.jpg + images/pEETxSxYazg.jpg \ + images/V3Po15bNErw.jpg diff --git a/doc/qtcreator/images/icons/easing-curve-linear-icon.png b/doc/qtcreator/images/icons/easing-curve-linear-icon.png new file mode 100644 index 00000000000..1e97dccc7ed Binary files /dev/null and b/doc/qtcreator/images/icons/easing-curve-linear-icon.png differ diff --git a/doc/qtcreator/images/icons/easing-curve-spline-icon.png b/doc/qtcreator/images/icons/easing-curve-spline-icon.png new file mode 100644 index 00000000000..3a4bc695fc9 Binary files /dev/null and b/doc/qtcreator/images/icons/easing-curve-spline-icon.png differ diff --git a/doc/qtcreator/images/icons/easing-curve-step-icon.png b/doc/qtcreator/images/icons/easing-curve-step-icon.png new file mode 100644 index 00000000000..ce1ec8917aa Binary files /dev/null and b/doc/qtcreator/images/icons/easing-curve-step-icon.png differ diff --git a/doc/qtcreator/images/icons/lockoff.png b/doc/qtcreator/images/icons/lockoff.png new file mode 100644 index 00000000000..e88792bc6e2 Binary files /dev/null and b/doc/qtcreator/images/icons/lockoff.png differ diff --git a/doc/qtcreator/images/icons/pin.png b/doc/qtcreator/images/icons/pin.png new file mode 100644 index 00000000000..ac65f66815e Binary files /dev/null and b/doc/qtcreator/images/icons/pin.png differ diff --git a/doc/qtcreator/images/qmldesigner-binding-editor.png b/doc/qtcreator/images/qmldesigner-binding-editor.png index fc6650bc5bc..0ffb326628d 100644 Binary files a/doc/qtcreator/images/qmldesigner-binding-editor.png and b/doc/qtcreator/images/qmldesigner-binding-editor.png differ diff --git a/doc/qtcreator/images/qmldesigner-bindings.png b/doc/qtcreator/images/qmldesigner-bindings.png index 017b22cd23f..32ccc569074 100644 Binary files a/doc/qtcreator/images/qmldesigner-bindings.png and b/doc/qtcreator/images/qmldesigner-bindings.png differ diff --git a/doc/qtcreator/images/qmldesigner-connections.png b/doc/qtcreator/images/qmldesigner-connections.png index ae0f3146a80..950c804306b 100644 Binary files a/doc/qtcreator/images/qmldesigner-connections.png and b/doc/qtcreator/images/qmldesigner-connections.png differ diff --git a/doc/qtcreator/images/studio-curve-editor.png b/doc/qtcreator/images/studio-curve-editor.png index ee44e74cc0a..01cd7f5ab4f 100644 Binary files a/doc/qtcreator/images/studio-curve-editor.png and b/doc/qtcreator/images/studio-curve-editor.png differ diff --git a/doc/qtcreator/images/studio-edit-keyframe.png b/doc/qtcreator/images/studio-edit-keyframe.png index 446187d1414..f2bcc891a58 100644 Binary files a/doc/qtcreator/images/studio-edit-keyframe.png and b/doc/qtcreator/images/studio-edit-keyframe.png differ diff --git a/doc/qtcreator/images/studio-timeline-empty.png b/doc/qtcreator/images/studio-timeline-empty.png new file mode 100644 index 00000000000..861a1021bba Binary files /dev/null and b/doc/qtcreator/images/studio-timeline-empty.png differ diff --git a/doc/qtcreator/images/studio-timeline-keyframe-track-colors.png b/doc/qtcreator/images/studio-timeline-keyframe-track-colors.png new file mode 100644 index 00000000000..3bea1a7a6b0 Binary files /dev/null and b/doc/qtcreator/images/studio-timeline-keyframe-track-colors.png differ diff --git a/doc/qtcreator/images/studio-timeline-no-tracks.png b/doc/qtcreator/images/studio-timeline-no-tracks.png new file mode 100644 index 00000000000..85a03a00b0a Binary files /dev/null and b/doc/qtcreator/images/studio-timeline-no-tracks.png differ diff --git a/doc/qtcreator/images/studio-timeline-settings.png b/doc/qtcreator/images/studio-timeline-settings.png index eefbc561cd9..cd6ed4c8a8b 100644 Binary files a/doc/qtcreator/images/studio-timeline-settings.png and b/doc/qtcreator/images/studio-timeline-settings.png differ diff --git a/doc/qtcreator/images/studio-timeline-with-empty-tracks.png b/doc/qtcreator/images/studio-timeline-with-empty-tracks.png new file mode 100644 index 00000000000..d116d43e366 Binary files /dev/null and b/doc/qtcreator/images/studio-timeline-with-empty-tracks.png differ diff --git a/doc/qtcreator/images/studio-timeline-with-tracks.png b/doc/qtcreator/images/studio-timeline-with-tracks.png new file mode 100644 index 00000000000..060db8aa2bd Binary files /dev/null and b/doc/qtcreator/images/studio-timeline-with-tracks.png differ diff --git a/doc/qtcreator/images/studio-timeline.png b/doc/qtcreator/images/studio-timeline.png index 49557eeaaed..18e85ca5c18 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/howto/creator-workspaces.qdoc b/doc/qtcreator/src/howto/creator-workspaces.qdoc index 704a221e6b1..20eacc48047 100644 --- a/doc/qtcreator/src/howto/creator-workspaces.qdoc +++ b/doc/qtcreator/src/howto/creator-workspaces.qdoc @@ -26,7 +26,7 @@ /*! \page creator-project-managing-workspaces.html \if defined(qtdesignstudio) - \previouspage creator-using-qt-quick-designer.html + \previouspage qtquick-curve-editor.html \nextpage creator-project-managing-sessions.html \else \previouspage creator-sidebars.html diff --git a/doc/qtcreator/src/qtcreator-toc.qdoc b/doc/qtcreator/src/qtcreator-toc.qdoc index 4ea17f3dd78..4a598ac7a45 100644 --- a/doc/qtcreator/src/qtcreator-toc.qdoc +++ b/doc/qtcreator/src/qtcreator-toc.qdoc @@ -96,7 +96,11 @@ \li \l{Library} \li \l{Navigator} \li \l{Properties} + \li \l{Connection View} + \li \l{States} \li \l{Transition Editor} + \li \l{Timeline} + \li \l{Curve Editor} \endlist \li \l {Creating UIs} \list @@ -121,11 +125,14 @@ \li \l {Adding Dynamics} \list \li \l{Creating Animations} + \list + \li \l{Editing Easing Curves} + \endlist \li \l{Adding Connections} \list - \li \l{Connecting Objects to Signals} - \li \l{Specifying Dynamic Properties} + \li \l{Connecting Components to Signals} \li \l{Adding Bindings Between Properties} + \li \l{Specifying Dynamic Properties} \li \l{Managing C++ Backend Objects} \endlist \li \l {Adding States} diff --git a/doc/qtcreator/src/qtquick/creator-logical-operators.qdocinc b/doc/qtcreator/src/qtquick/creator-logical-operators.qdocinc index a8bd94c4621..79284654a4f 100644 --- a/doc/qtcreator/src/qtquick/creator-logical-operators.qdocinc +++ b/doc/qtcreator/src/qtquick/creator-logical-operators.qdocinc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -84,6 +84,14 @@ different type. \endtable + \if defined(qtdesignstudio) + Alternatively, you can use \uicontrol {And Operator}, + \uicontrol {Or Operator}, and \uicontrol {Not Operator} + components to bind property values using the boolean AND, + OR, and NOT operator. For more information, see \l{Logic Helpers}. + \endif + + In addition, you can use arithmetic operators to compare numbers before checks. However, we recommend that you create separate properties for this purpose whenever possible. diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-app-tutorial.qdoc b/doc/qtcreator/src/qtquick/creator-only/qtquick-app-tutorial.qdoc index f9822526ccd..3fbef6889c6 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-app-tutorial.qdoc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-app-tutorial.qdoc @@ -248,7 +248,7 @@ \list \li \l{Adding States} - \li \l{Connecting Objects to Signals} + \li \l{Connecting Components to Signals} \endlist \section1 Animating Transitions diff --git a/doc/qtcreator/src/qtquick/library/qtquick-controls.qdoc b/doc/qtcreator/src/qtquick/library/qtquick-controls.qdoc index d3db5c08b58..d5b86029742 100644 --- a/doc/qtcreator/src/qtquick/library/qtquick-controls.qdoc +++ b/doc/qtcreator/src/qtquick/library/qtquick-controls.qdoc @@ -76,7 +76,7 @@ can define an area smaller or larger than the parent. Several controls,such as \l {Button}{buttons}, contain a mouse area. - A mouse area emits \l{Connecting Objects to Signals}{signals} in response + A mouse area emits \l{Connecting Components to Signals}{signals} in response to different mouse events: \list @@ -437,7 +437,7 @@ \section2 Button Signals A button emits the \c clicked() signal when it is activated by users. - \l{Connecting Objects to Signals}{Connect to this signal} to perform + \l{Connecting Components to Signals}{Connect to this signal} to perform the button's action. Buttons provide the following additional signals: \c canceled(), \c doubleClicked(), \c pressed(), \c released(), and \c pressAndHold() for long presses. diff --git a/doc/qtcreator/src/qtquick/qtquick-components.qdoc b/doc/qtcreator/src/qtquick/qtquick-components.qdoc index a03b2ce4576..b2e47db3f5a 100644 --- a/doc/qtcreator/src/qtquick/qtquick-components.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-components.qdoc @@ -90,7 +90,7 @@ \li To enable users to interact with components, connect the components to signals in the \uicontrol Connections view. For example, you can specify what happens when a component is clicked. - For more information, see \l{Connecting Objects to Signals}. + For more information, see \l{Connecting Components to Signals}. \image qmldesigner-connections.png "Connections view Connections tab" \li To dynamically change the behavior of an object when another object changes, create bindings between components in the diff --git a/doc/qtcreator/src/qtquick/qtquick-connection-editor-bindings.qdoc b/doc/qtcreator/src/qtquick/qtquick-connection-editor-bindings.qdoc index 6a6012dcbd4..610b582e512 100644 --- a/doc/qtcreator/src/qtquick/qtquick-connection-editor-bindings.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-connection-editor-bindings.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -25,43 +25,44 @@ /*! \page quick-property-bindings.html - \previouspage quick-dynamic-properties.html - \if defined(qtdesignstudio) - \nextpage quick-states.html - \else - \nextpage quick-connections-backend.html - \endif + \previouspage quick-signals.html + \nextpage quick-dynamic-properties.html \title Adding Bindings Between Properties - To dynamically change the behavior of an object, you can create a \e binding - between the properties of two objects. To create a property binding, a - property is assigned a JavaScript expression that evaluates to the desired - value. At its simplest, a binding may be a reference to another property. - For example, the height of an object can be bound to the height of its - parent, so that when the parent height changes, the object height is + To dynamically change the behavior of a component, you can create a + \e binding between the properties of two components. To create a property + binding, a property is assigned a JavaScript expression that evaluates to + the desired value. Behind the scenes, the variables in the binding + expression are monitored. When a change is detected, the binding + expression is re-evaluated and the new result is applied to the property. + + At its simplest, a binding may be a reference to another property. + For example, the height of a component can be bound to the height of its + parent, so that when the parent height changes, the component height is adjusted automatically. For more information about the use of property bindings, see \l{Property Binding}. - You can create bindings between objects in the \uicontrol Connections view. + You can create bindings between components in \uicontrol Bindings. \image qmldesigner-bindings.png - To bind a property of an object to the property of another object: + To bind a property of a component to the property of another component: \list 1 - \li In the \uicontrol {Connections} view, select the - \uicontrol {Bindings} tab. + \li Select \uicontrol View > \uicontrol Views > + \uicontrol {Connection view} > \uicontrol {Bindings}. \li Select the \inlineimage plus.png (\uicontrol Add) button to add a binding for the currently selected - item. The ID is displayed in the \uicontrol Item column. + component. The component ID is displayed in the \uicontrol Item + column. \li Double-click the value in the \uicontrol Property column to select the property to bind to a source property. \li Double-click the value in the \uicontrol {Source Item} column to - select the object whose property you want to use to determine the - behavior of the target object. + select the component whose property you want to use to determine the + behavior of the target component. \li Double-click the value in the \uicontrol {Source Property} column to select the property to bind the target property to. \endlist @@ -72,6 +73,17 @@ \image qmldesigner-binding-editor.png "Binding Editor" + For examples of creating property bindings, see: + + \list + \li \l{Using States to Change Component Property Values} + \if defined(qtdesignstudio) + \li \l{Exporting Properties} + \else + \li \l{Moving the Bubble} in \l{Creating a Mobile Application} + \endif + \endlist + For more information, watch the following video: \youtube UfvA04CIXv0 diff --git a/doc/qtcreator/src/qtquick/qtquick-connection-editor-properties.qdoc b/doc/qtcreator/src/qtquick/qtquick-connection-editor-properties.qdoc index c370f36b3f7..efcd189a302 100644 --- a/doc/qtcreator/src/qtquick/qtquick-connection-editor-properties.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-connection-editor-properties.qdoc @@ -24,40 +24,45 @@ ****************************************************************************/ /*! - \previouspage quick-signals.html \page quick-dynamic-properties.html - \nextpage quick-property-bindings.html + \previouspage quick-property-bindings.html + \if defined(qtdesignstudio) + \nextpage quick-states.html + \else + \nextpage quick-connections-backend.html + \endif \title Specifying Dynamic Properties - Each predefined QML type has a set of predefined properties that you can - specify values for. You can add custom properties that would not otherwise - exist for a particular type. You bind the properties to dynamic expressions - to define global properties for an object that can be read by other objects. - For example, you can specify global properties for the root object that you - can use in the child objects. + Each preset \l{glossary-component}{component} has a set of preset properties + that you can specify values for. You can add custom properties that would + not otherwise exist for a particular \l{Component Types}{component type}. + You bind the properties to dynamic expressions to define global properties + for a component that can be read by other components. For example, you can + specify global properties for the root component that you can use in the + child components. For example, to specify spacing between UI elements, you could define a - margin for an object of a QML type that does not have a margin property, - and then use bindings to refer to the value of the margin property from - other objects. + margin for a component that does not have a margin property, and then use + \l{Adding Bindings Between Properties}{bindings} to refer to the value of + the margin property from other components. - Similarly, you can add custom properties for your own QML types that are - based on the predefined types. + Similarly, you can add custom properties for your own components that are + based on preset components. - You can add properties for objects in the \uicontrol Connections view, - \uicontrol Properties tab. + You can add properties for components in \uicontrol {Connections View} > + \uicontrol Properties. \image qmldesigner-dynamicprops.png "Custom properties in Connection View Custom Properties tab" - To add properties for an object: + To add properties for a component: \list 1 \li Select \uicontrol View > \uicontrol Views > \uicontrol {Connections View} > \uicontrol {Properties}. \li Select the \inlineimage plus.png (\uicontrol Add) button to add a dynamic property for the currently - selected item. The item ID is displayed in the \uicontrol Item + selected component. The component ID is displayed in the \uicontrol Item column. \li Double-click the value in the \uicontrol Property column to give a name to the property. Property names must begin with a lower case @@ -76,17 +81,19 @@ \image qmldesigner-binding-editor.png "Binding Editor" - The properties you add for a QML type are displayed in the - \uicontrol Properties view when you select a component of - that type in \uicontrol Navigator or \uicontrol {Form Editor}. + The properties you add for a component are displayed in the \l Properties + view when you select a component of that type in \l Navigator or + \l {Form Editor}. \image qtquick-custom-properties.png "Custom properties in Properties view" For more information about setting property values in the - \uicontrol Properties view, see \l{Specifying Component Properties}. + \l Properties view, see \l{Specifying Component Properties}. + \if defined(qtcreator) For an example of using custom properties in an application, see \l{Creating a Mobile Application}. + \endif \section1 Supported Property Types diff --git a/doc/qtcreator/src/qtquick/qtquick-connection-editor-signals.qdoc b/doc/qtcreator/src/qtquick/qtquick-connection-editor-signals.qdoc index 43679007285..00ec0482642 100644 --- a/doc/qtcreator/src/qtquick/qtquick-connection-editor-signals.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-connection-editor-signals.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -26,55 +26,57 @@ /*! \previouspage qmldesigner-connections.html \page quick-signals.html - \nextpage quick-dynamic-properties.html + \nextpage quick-property-bindings.html - \title Connecting Objects to Signals + \title Connecting Components to Signals + + A signal and handler mechanism enables components to respond to application + events, which are represented by \e signals. When a signal is emitted, the + corresponding \e {signal handler} is invoked to respond to the event by + using scripts or other operations placed in the handler. To receive a notification when a particular signal is emitted for a - particular object, the object definition should declare a signal handler + particular component, the component definition should declare a signal handler named \e {on} where \e {} is the name of the signal, with the first letter capitalized. The signal handler should contain the JavaScript code to be executed when the signal handler is invoked. - QML types have predefined signals that are emitted when users interact with - the application. For example, the \l {Mouse Area} type has a - \c clicked signal that is emitted whenever the mouse is - clicked within the area. Since the signal name is \c clicked, the signal - handler for receiving this signal is named \c onClicked. + Components have predefined signals that are emitted when users interact with + the application. For example, the \l {Mouse Area} component has a \c clicked + signal that is emitted whenever the mouse is clicked within the area. Since + the signal name is \c clicked, the signal handler for receiving this signal + is named \c onClicked. - A signal is automatically emitted when the value of a QML property changes. + A signal is automatically emitted when the value of a property changes. This type of signal is a \e{property change signal} and signal handlers for these signals are written in the form \c onChanged, where \e is the name of the property, with the first letter capitalized. - For example, the Mouse Area type has a \c pressed property. To receive a - notification whenever this property changes, you would use a signal handler + For example, the Mouse Area component has a \c pressed property. To receive + a notification whenever this property changes, you would use a signal handler called \c onPressedChanged. For more information about signals and signal handlers, see \l{Signal and Handler Event System}. - To access a signal outside of the object that emits it, you can use the - \l Connections type for connecting to signals of arbitrary objects. A - connections object can receive any signal from its specified target. - You can connect objects to signals that are available to them in the - \uicontrol Connections view. + You can connect components to signals that are available to them in + \uicontrol Connections. \image qmldesigner-connections.png - To connect objects to signals: + To connect components to signals: \list 1 - \li In the \uicontrol {Connections} view, select the - \uicontrol {Connections} tab. + \li Select \uicontrol View > \uicontrol Views > + \uicontrol {Connection View} > \uicontrol {Connections}. \li Select the \inlineimage plus.png (\uicontrol Add) button to add a connection. \li Double-click the value in the \uicontrol Target column to add the - object to connect to a signal. + component to connect to a signal. \li Double-click the value in the \uicontrol {Signal Handler} column to select the signal that the connection will listen to from a list of - all signals available for the object. + all signals available for the component. \li Double-click the value in the \uicontrol Actions column to specify the action to perform when the signal is emitted. You use JavaScript to specify the actions. @@ -84,6 +86,18 @@ in the context menu to specify the connection in \uicontrol {Connection Editor}. + \if defined(qtcreator) + For an example of using the \uicontrol {Connections} view, see + \l{Connecting Mouse Clicks to State Changes}. + \else + For examples of using the \uicontrol {Connections} view, see: + + \list + \li \l{Connecting Buttons to States} in \l{Log In UI - Part 3} + \li \l{Connecting Buttons to State Changes} in \l{Washing Machine UI} + \endlist + \endif + \section1 Adding Signal Handlers If a signal handler that you need is not listed in the @@ -100,43 +114,41 @@ \li Select \uicontrol OK. \endlist - The added signal handler is automatically \l{Using Qt Quick UI Forms} + The added signal handler is automatically \l{Adding Property Aliases} {exported as a property}. - \if defined(qtdesignstudio) \section1 Adding Actions and Assignments You use the \uicontrol {Connection Editor} to create the JavaScript expressions for \e actions and \e assignments. An \e action connects - an object to a signal, whereas an \e assignment fetches property values - from another object. + an component to a signal, whereas an \e assignment fetches property values + from another component. For more information about the logical operators that you can use to construct conditional expressions, see \l {Summary of Logical Operators}. To create JavaScript expressions for actions: - \image qtquick-connection-editor-action.png - \list 1 - \li Select \uicontrol Action as the type of the connections object. - \li Select the object to connect to a signal. + \li Select \uicontrol {Open Connection Editor} in the context menu + in \uicontrol {Connections}. + \image qtquick-connection-editor-action.png + \li Select \uicontrol Action as the type of the connections component. + \li Select the component to connect to a signal. \li Select the action to perform when the signal is emitted. \endlist To create JavaScript expressions for assignments: - \image qtquick-connection-editor-assignment.png - \list 1 - \li Select \uicontrol Assignment as the type of the connections object. - \li Select the target object for the property assignment. - \li Select the property of the target object to assign a value to. - \li Select the source object for the property assignment. - \li Select the property of the source object to fetch the value from. + \li Select \uicontrol {Open Connection Editor} in the context menu + in \uicontrol {Connections}. + \image qtquick-connection-editor-assignment.png + \li Select \uicontrol Assignment as the type of the connections + component. + \li Select the target component for the property assignment. + \li Select the property of the target component to assign a value to. + \li Select the source component for the property assignment. + \li Select the property of the source component to fetch the value from. \endlist - - For an example of connecting the \c clicked signal of a button to a - \l{Adding States}{state}, see \l {Log In UI - Part 3}. - \endif */ diff --git a/doc/qtcreator/src/qtquick/qtquick-connection-editor.qdoc b/doc/qtcreator/src/qtquick/qtquick-connection-editor.qdoc index 395327e1bce..2c3d6a15f15 100644 --- a/doc/qtcreator/src/qtquick/qtquick-connection-editor.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-connection-editor.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -24,49 +24,42 @@ ****************************************************************************/ /*! - \previouspage studio-timeline.html + \previouspage qtquick-editing-easing-curves.html \page qmldesigner-connections.html \nextpage quick-signals.html \title Adding Connections - The user interface components and the application need to communicate with - each other. For example, a button needs to know that the user has clicked - on it. The button may then change color to indicate its state or perform an - action. Further, the application needs to know whether the user is clicking - the button, because it may need to relay this clicking event to other - applications. - - QML has a signal and handler mechanism, that enables components to respond - to application events. Events are represented by \e signals. When a signal - is emitted, the corresponding \e {signal handler} is invoked to respond to - the event by using scripts or other operations placed in the handler. - - To access a signal outside of the object that emits it, you can use the - \l Connections type for connecting to signals of arbitrary objects. A - Connections object can receive any signal from its specified target. - - A component's property can be assigned a static value which stays constant - until it is explicitly assigned a new value. However, to make the fullest - use of QML and its built-in support for dynamic object behaviors, most QML - types use property bindings. This means that you can specify relationships - between different object properties so that when a property's dependencies - change in value, the property's value is automatically updated accordingly. - - Behind the scenes, the QML engine monitors the property's dependencies (that - is, the variables in the binding expression). When a change is detected, the - QML engine re-evaluates the binding expression and applies the new result to - the property. - - The following sections describe how to use the \uicontrol {Connections} view - to perform the following tasks: - \list - \li \l{Connecting Objects to Signals} - \li \l{Specifying Dynamic Properties} + \li \l{Connecting Components to Signals} + + A signal and handler mechanism enables components to respond to + application events, which are represented by \e signals. When a + signal is emitted, the corresponding \e {signal handler} is + invoked to respond to the event by applying an action, for + example. + \li \l{Adding Bindings Between Properties} + + A component's property can be assigned a static value that stays + constant until it is explicitly changed. To make the UI more + dynamic, you can use \e {property bindings}. This means that you + can specify relationships between component properties so that when + the value of a property changes, the values of any properties that + are bound to it are automatically updated accordingly. + + \li \l{Specifying Dynamic Properties} + + Each preset component has a set of preset properties that you + can specify values for. You can add custom properties that would + not otherwise exist for a particular \l{Component Types} + {component type} or your custom components. + \if defined(qtcreator) \li \l{Managing C++ Backend Objects} + + Application developers can access QObject objects implemented in C++ + from QML files. \endif \endlist diff --git a/doc/qtcreator/src/qtquick/qtquick-connection-view.qdoc b/doc/qtcreator/src/qtquick/qtquick-connection-view.qdoc new file mode 100644 index 00000000000..5529ffa2de2 --- /dev/null +++ b/doc/qtcreator/src/qtquick/qtquick-connection-view.qdoc @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Creator documentation. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** +****************************************************************************/ + +/*! + \page qtquick-connection-view.html + \previouspage qtquick-properties-view.html + \nextpage qtquick-states-view.html + + \title Connection View + + The \uicontrol {Connection View} is a collection of views that enable you + to create connections between components and the application, to bind + component properties together, and to add custom properties for components. + + \image qmldesigner-connections.png "Connections View" + + The \l{glossary-component}{components} of the application UI and the + application logic need to communicate with each other. For example, a + button needs to know that the user has clicked it. The button may then + change color to indicate its state or perform an action. Further, the + application needs to know whether the user clicked the button because + it may need to relay this clicking event to other applications. For + this purpose, a button typically contains a \l{Mouse Area} component, + which can receive different pointer events and emit \e signals in + response to them. + + Another way to connect components is to bind their \l{Properties} + {properties} together. A component's property can be assigned a static + value which stays constant until it is explicitly changed. To make the + UI more dynamic, you can use \e {property bindings}. This means that + you can specify relationships between component properties so that when + the value of a property changes, the values of any properties that are + bound to it are updated accordingly. + + Each preset component has a set of \l{Specifying Component Properties} + {preset properties} that you can specify values for. You can add + custom properties that would not otherwise exist for a particular + \l{Component Types}{component type}. + + \if defined(qtcreator) + In addition, application developers can use the \uicontrol Backends view + to access QObject objects implemented in C++ from QML files. + \endif + + \section1 Summary of Connection Views + + \table + \header + \li View + \li Purpose + \li Read More + \row + \li \uicontrol Connections + \li Create connections between components and the application logic + by accessing signals outside of the components that emit them. + \li \l{Connecting Components to Signals} + \row + \li \uicontrol Bindings + \li Dynamically change the behavior of a component by creating a + binding between the properties of two components. + \li \l{Adding Bindings Between Properties} + \row + \li \uicontrol Properties + \li Add custom properties that would not otherwise exist for a + particular preset component or your own custom component. + \li \l{Specifying Dynamic Properties} + \if defined(qtcreator) + \row + \li \uicontrol Backends + \li Access QObject objects implemented in C++ from QML files. + \li \l{Managing C++ Backend Objects} + \endif + \endtable +*/ diff --git a/doc/qtcreator/src/qtquick/qtquick-curve-editor.qdoc b/doc/qtcreator/src/qtquick/qtquick-curve-editor.qdoc new file mode 100644 index 00000000000..c56cea247cc --- /dev/null +++ b/doc/qtcreator/src/qtquick/qtquick-curve-editor.qdoc @@ -0,0 +1,125 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Creator documentation. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** +****************************************************************************/ + +/*! + \page qtquick-curve-editor.html + \previouspage qtquick-timeline-view.html + \nextpage creator-project-managing-workspaces.html + + \title Curve Editor + + \uicontrol {Curve Editor} shows the interpolated values of an animated + property over the animation range. + + \image studio-curve-editor.png "Curve Editor" + + When you edit an animation curve, you implicitly edit the + \l{Editing Easing Curves}{easing curves} that the underlying system uses + to define an animation. The animation curve is an extension to visualize + both the value of a keyframe and the interpolation between keyframes + simultaneously. + + You can use the toolbar buttons to add \uicontrol Linear, \uicontrol Step, + or \uicontrol Spline interpolation between two keyframes. + + When you set interpolation to \uicontrol Spline, handles appear in + \uicontrol {Curve Editor} that you can use to modify the curve. Select + \uicontrol Unify to lock the handle on the left of a keyframe to the one + on the right of it so that moving the left handle also moves the right + handle. + + If the component that contains the animated property has been locked + in \l Navigator, you can select \inlineimage icons/lockon.png + to unlock it. You can also lock individual easing curves for editing. + + To lock an animation curve, hover the mouse over the keyframe in the list, + and then select \inlineimage icons/lockoff.png + . + + To pin an animation curve, hover the mouse over the keyframe in the list, + and then select \inlineimage icons/pin.png + . + + \section1 Curve Editor Toolbar + + The \uicontrol {Curve Editor} toolbar contains the following buttons and + fields. + + \table + \header + \li Button/Field + \li Action + \row + \li \inlineimage icons/easing-curve-linear-icon.png + \li \uicontrol Linear specifies that the interpolation between + keyframes is linear. + \row + \li \inlineimage icons/easing-curve-step-icon.png + \li \uicontrol Step uses steps for interpolation between keyframes. + \row + \li \inlineimage icons/easing-curve-spline-icon.png + \li \uicontrol Spline uses bezier spline curves for interpolation + between keyframes and displays handles for managing them. + \row + \li \uicontrol {Set Default} + \li Currently not used. + \row + \li \uicontrol Unify + \li For \uicontrol Spline curves, locks the handle on the left of a + keyframe to the one on the right. + \row + \li Start Frame + \li Specifies the first frame of the curve. + \row + \li End Frame + \li Specifies the last frame of the curve. + \row + \li Current Frame + \li Displays the frame that the playhead is currently on. Enter a + number in the field to move the playhead to the respective frame. + \endtable + + \section1 Editing Animation Curves + + To edit animation curves: + + \list 1 + \li In the \l Timeline view, animate at least one property value by + \l{Managing Keyframes}{inserting keyframes} for it. + \li Select \uicontrol View > \uicontrol Views > + \uicontrol {Curve Editor} to open the animation curve editor. + \li Right-click in \uicontrol {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. + \endlist + + Your changes are automatically saved when you close the view. + + \section1 Deleting Keyframes in Curve Editor + + To delete the selected keyframe, select \uicontrol {Delete All Keyframes} + in the context menu. +*/ diff --git a/doc/qtcreator/src/qtquick/qtquick-designer.qdoc b/doc/qtcreator/src/qtquick/qtquick-designer.qdoc index 43966d926c9..3ac6eb0353f 100644 --- a/doc/qtcreator/src/qtquick/qtquick-designer.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-designer.qdoc @@ -89,12 +89,12 @@ \li Enables you to modify the properties of the selected component. \li \l {Specifying Component Properties} \row - \li \l{Adding Connections}{Connection View} + \li \l{Connection View} \li Enables you to add functionality to the UI by creating - connections between objects, signals, and object properties. + connections between components, signals, and component properties. \li \l{Adding Connections} \row - \li \l{Adding States}{States} + \li \l States \li Displays the different states that can be applied to a component. Typically, states describe UI configurations, such as the visibility and behavior of components and the available user @@ -106,16 +106,15 @@ the changes between states. \li \l{Animating Transitions Between States} \row - \li \l{Creating Animations}{Timeline} + \li \l Timeline \li Provides a timeline and keyframe based editor for animating the properties of components. \li \l{Creating Animations} \row - \li \l{Editing Animation Curves}{Curve Editor} + \li \l{Curve Editor} \li Enables you to view and modify the whole animation curve by inserting keyframes to the curve and dragging them and the point - handlers to modify the curve. You can modify the appearance of - the curve in the style editor. + handlers to modify the curve. \li \l {Editing Animation Curves} \row \li \l{Working in Edit Mode}{Text Editor} diff --git a/doc/qtcreator/src/qtquick/qtquick-easing-curve-editor.qdoc b/doc/qtcreator/src/qtquick/qtquick-easing-curve-editor.qdoc new file mode 100644 index 00000000000..04e03ac5a0b --- /dev/null +++ b/doc/qtcreator/src/qtquick/qtquick-easing-curve-editor.qdoc @@ -0,0 +1,106 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Creator documentation. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** +****************************************************************************/ + +/*! + \page qtquick-editing-easing-curves.html + \previouspage studio-timeline.html + \nextpage qmldesigner-connections.html + + \title Editing Easing Curves + + You can use \uicontrol {Easing Curve Editor} to edit the easing curve + between two keyframes. + + \image studio-easing-curve-editor.png "Easing Curve Editor" + + You can use the preset curves or modify them by dragging the curve handles + around. You can add points to the curve and drag them and the point handles + to modify the curve. When you are happy with the curve, you can save it as + a custom curve. For more information about easing curve types, see the + technical documentation for \l [QML] {PropertyAnimation}{easing curves}. + + To zoom into and out of the easing curve editor, use the mouse + roller. To reset the zoom factor, right-click in the picker and + select \uicontrol {Reset Zoom}. + + You can also use the more advanced \l {Curve Editor} that + shows the interpolated values of an animated property over + the \l{Creating Animations}{animation} range. + + The animation curves present a more readable view of the animation by + showing the effective values of the animated properties over the animation + range. In order to do so, they need to be converted to and from easing + curves. This comes with the following side effects: + + \list + \li Interpolation between identical current and previous keyframe values + is meaningless regardless of what the easing curve looks like. + \li Some easing curves are not trivially mappable to animation curves + and are therefore painted in a different color and without handles. + \endlist + + \section1 Attaching Easing Curves to Keyframes + + To attach easing curves to keyframes: + + \list 1 + \li Right-click a keyframe in \l Timeline and select + \uicontrol {Easing Curve Editor} in the context menu. + \li Select an easing curve in the \uicontrol Presets tab. + \li In the \uicontrol {Duration (ms)} field, select the + duration of the easing function in milliseconds. + \li Select \uicontrol Preview to preview the curve. + \li Select \uicontrol OK to attach the easing curve to the + keyframe, close \uicontrol {Easing Curve Editor}, and + return to \l Timeline. + \endlist + + When you attach easing curves to keyframes, the shape of the + \l{keyframe_marker}{keyframe marker} on a keyframe track in + \l Timeline changes from \inlineimage keyframe_linear_inactive.png + to a marker that describes the type of the selected easing curve. + + \section1 Customizing Easing Curves + + To customize easing curves: + + \list 1 + \li In \uicontrol {Easing Curve Editor}, select an easing curve in + the \uicontrol Presets tab. + \li Drag the curve handles to modify the curve. + \li Right-click in the editor, and select \uicontrol {Add Point} to add + points to the curve. + \li Drag the points or the point handles to modify the curve. If the + curve becomes invalid, it turns red in the editor and the + \uicontrol Save button is disabled. + \li Select \uicontrol Save to save your changes to the curve. + \li In the \uicontrol Name field, enter a name for the custom curve, + and then select \uicontrol OK to save the curve in the + \uicontrol Custom tab. + \endlist + + To paste easing curve definitions to \uicontrol {Easing Curve Editor} as + text, select the \uicontrol Text tab. +*/ diff --git a/doc/qtcreator/src/qtquick/qtquick-navigator.qdoc b/doc/qtcreator/src/qtquick/qtquick-navigator.qdoc index e6eb7db95fc..59dcdad2997 100644 --- a/doc/qtcreator/src/qtquick/qtquick-navigator.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-navigator.qdoc @@ -26,7 +26,7 @@ /*! \page qtquick-navigator.html \previouspage quick-library.html - \nextpage qtquick-properties.html + \nextpage qtquick-properties-view.html \title Navigator diff --git a/doc/qtcreator/src/qtquick/qtquick-properties-view.qdoc b/doc/qtcreator/src/qtquick/qtquick-properties-view.qdoc index 61c6312a5ab..39a6c1ef80d 100644 --- a/doc/qtcreator/src/qtquick/qtquick-properties-view.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-properties-view.qdoc @@ -26,7 +26,7 @@ /*! \page qtquick-properties-view.html \previouspage qtquick-navigator.html - \nextpage creator-project-managing-workspaces.html + \nextpage qtquick-connection-view.html \title Properties diff --git a/doc/qtcreator/src/qtquick/qtquick-states-view.qdoc b/doc/qtcreator/src/qtquick/qtquick-states-view.qdoc new file mode 100644 index 00000000000..66179af77a1 --- /dev/null +++ b/doc/qtcreator/src/qtquick/qtquick-states-view.qdoc @@ -0,0 +1,103 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Creator documentation. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** +****************************************************************************/ + +/*! + \page qtquick-states-view.html + \previouspage qtquick-connection-view.html + \nextpage qtquick-transition-editor.html + + \title States + + The \uicontrol States view displays the different \l{Adding States}{states} + of a UI. + + \image qmldesigner-transitions.png "States view" + + To open the \uicontrol States view, select \uicontrol View > + \uicontrol Views > \uicontrol States. + + To collapse or expand the \uicontrol States view, select: + + \list + \li Select \uicontrol View > \uicontrol Views > + \uicontrol {Toggle States}. + \li Press \key {Ctr+Alt+S} on Windows or \key {Cmd+Option+S} on \macOS. + \li Right-click the view and select \uicontrol Collapse or + \uicontrol Expand. + \endlist + + Initially, \uicontrol States displays a \e {base state} that shows the + selected \l{glossary-component}{component} in its initial state. To add + states, select \uicontrol {Create New State}. + + For more information, watch the following video: + + \youtube FzmLuRHQXaw + + \section1 Summary of States View Actions + + To open the \uicontrol Actions menu, select + \inlineimage icons/action-icon.png + . The actions available in the menu depend on the current context. For + example, the option for editing an annotation becomes available after + you add an annotation. + + \table + \header + \li Action + \li Purpose + \li Read More + \row + \li \uicontrol {Set when Condition} + \li Determines when a state should be applied. + \li \l{Applying States} + \row + \li \uicontrol {Reset when Condition} + \li Removes \c when condition for the state. + \li \l{Applying States} + \row + \li \uicontrol {Set as Default} + \li Sets the current state as the startup state of the application. + \li \l{Setting the Default State} + \row + \li\uicontrol {Reset Default} + \li Resets the current state as the default state. + \li \l{Setting the Default State} + \row + \li \uicontrol {Add Annotation} + \li Opens the \uicontrol {Annotation Editor} when you can add an + annotation for the states that you create. + \li \l{Annotating Designs} + \row + \li \uicontrol {Edit Annotation} + \li Opens the \uicontrol {Annotation Editor} where you can edit the + annotation for the state. + \li \l{Annotating Designs} + \row + \li \uicontrol {Add Annotation} + \li Removes the annotation for the state. + \li \l{Annotating Designs} + \endtable +*/ diff --git a/doc/qtcreator/src/qtquick/qtquick-states.qdoc b/doc/qtcreator/src/qtquick/qtquick-states.qdoc index f4ed8940e14..a79cda9becc 100644 --- a/doc/qtcreator/src/qtquick/qtquick-states.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-states.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -34,13 +34,13 @@ \title Adding States - User interfaces are designed to present different interface configurations - in different scenarios, or to modify their appearances in response to user + UIs are designed to present different UI configurations in different + scenarios, or to modify their appearances in response to user interaction. Often, there are a set of changes that are made concurrently, - such that the interface could be seen to be internally changing from one + such that the UI could be seen to be internally changing from one \e state to another. - This applies generally to interfaces regardless of their complexity. A photo + This applies generally to UIs regardless of their complexity. A photo viewer may initially present images in a grid, and when an image is clicked, change to a detailed state where the individual image is expanded and the interface is changed to present new options for image editing. At the other @@ -48,16 +48,16 @@ \e pressed state in which its color and position are modified so that it appears to be pressed down. - In QML, any item can change between different states to apply sets of - changes that modify the properties of relevant items. Each state can + Any component can change between different states to apply sets of + changes that modify the properties of relevant components. Each state can present a different configuration that can, for example: \list - \li Show some UI items and hide others. + \li Show some UI components and hide others. \li Present different available actions to the user. \li Start, stop, or pause animations. \li Execute some script required in the new state. - \li Change a property value for a particular item. + \li Change a property value for a particular component. \li Show a different view. \endlist @@ -65,24 +65,17 @@ \section1 Creating States - To open the \uicontrol States view, select \uicontrol View > - \uicontrol Views > \uicontrol States. To collapse or expand - the open view, select \uicontrol {Toggle States} or press - \key {Ctr+Alt+S}. You can also right-click the view and select - \uicontrol Collapse or \uicontrol Expand. - - The \uicontrol States view displays the different \l{State}{states} - of a UI, beginning with a \e {base state}. + You can create states in the \l States view, by selecting + \uicontrol {Create New State}. \image qmldesigner-transitions.png "States view" - To add states, select \uicontrol {Create New State}. Click the new state to - switch to it in \uicontrol {Form Editor}, and then modify the properties of - components in \uicontrol Properties. + Click the new state to switch to it in \l {Form Editor}, and then modify the + properties of components in \l Properties. For example, to change the appearance of a button, you can hide the button image and show another image in its place. Or, to add movement to the view, - you can change the position of an object in \uicontrol {Form Editor} + you can change the position of a component in \uicontrol {Form Editor} and then add animation to the change between the states. The properties that you change in a state are highlighted with blue color. @@ -92,9 +85,8 @@ \image qmldesigner-states.png "States and Properties views" \note If you have \l{Locking Components}{locked a component} in - \uicontrol Navigator, and you attempt to remove states where you - change the values of its properties, you are prompted to confirm - the removal. + \l Navigator, and you attempt to remove states where you change the + values of its properties, you are prompted to confirm the removal. For more information, watch the following video: @@ -170,18 +162,18 @@ \section1 Using States - To keep the QML code clean, you should create a base state that contains all - the types you will need in the application. You can then create states, - in which you hide and show a set of items and modify their properties. + To keep the code clean, you should create a base state that contains all + the components you will need in the application. You can then create states, + in which you hide and show a set of components and modify their properties. This allows you to: \list - \li Align items on different views with each other. - \li Avoid excessive property changes. If an item is invisible in the - base state, you must define all changes to its child types as - property changes, which leads to complicated QML code. + \li Align components on different views with each other. + \li Avoid excessive property changes. If a component is invisible in + the base state, you must define all changes to its child components + as property changes, which leads to complicated code. \li Minimize the differences between the base state and the other states - to keep the QML code short and readable and to improve performance. + to keep the code short and readable and to improve performance. \li Avoid problems when using transitions and animation when changing states. \endlist @@ -191,18 +183,20 @@ \image qmldesigner-screen-design.png "Designing views" \list 1 - \li In the base state, add all items you will need in the application - (1). While you work on one view, you can click the + \li In the base state, add all components you will need in the + application (1). While you work on one view, you can click the \inlineimage eye_open.png - icon to hide items on the canvas that are not part of a view. - \li In \uicontrol States, click the empty slot to create a - new state and give it a name. For example, \c Normal. - \li In \uicontrol Properties (2), deselect the \uicontrol Visibility - check box or set \uicontrol Opacity to 0 for each item that is not - needed in this view. If you specify the setting for the parent item, - all child items inherit it and are also hidden. + icon in \l Navigator to hide components on the canvas that are + not part of a view. + \li In \uicontrol States, select \uicontrol {Create New State} to create + a new state and give it a name. For example, \c Normal. + \li In \l Properties (2), deselect the \uicontrol Visibility + check box or set \uicontrol Opacity to 0 for each component that + is not needed in this view. If you specify the setting for the + parent component, all child components inherit it and are also + hidden. \li Create additional states for each view and set the visibility - or opacity of the items in the view. + or opacity of the components in the view. \li To determine which state is applied when the application starts, select \uicontrol Actions > \uicontrol {Set as Default}. \endlist diff --git a/doc/qtcreator/src/qtquick/qtquick-timeline-view.qdoc b/doc/qtcreator/src/qtquick/qtquick-timeline-view.qdoc new file mode 100644 index 00000000000..a9fd2855058 --- /dev/null +++ b/doc/qtcreator/src/qtquick/qtquick-timeline-view.qdoc @@ -0,0 +1,281 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Creator documentation. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** +****************************************************************************/ + +/*! + \page qtquick-timeline-view.html + \previouspage qtquick-transition-editor.html + \nextpage qtquick-curve-editor.html + + \title Timeline + + You can use the timeline and keyframe based editor in the + \uicontrol Timeline view to animate the properties of + \l{glossary_component}{components}. The view is empty until + you create a timeline. + + \image studio-timeline-empty.png "Empty Timeline view" + + Select the \inlineimage plus.png + (\uicontrol {Add Timeline (A)}) button, or press \key {A} to + \l{Creating Timelines}{create a timeline} and specify settings + for it in the \uicontrol {Timeline Settings} dialog. + + \image studio-timeline-settings.png "Timeline Settings dialog" + + When you select \uicontrol Close, the \uicontrol Timeline view appears. + It now displays a \l{Timeline Toolbar}{toolbar} and a ruler but no + keyframe tracks. + + \image studio-timeline-no-tracks.png "Timeline view without keyframe tracks" + + To animate component properties in the \uicontrol Timeline view, you + must \l{Setting Keyframe Values}{insert keyframes} for them. In the + \l Properties view, select \uicontrol Settings > + \uicontrol {Insert Keyframe} for a property that you want to animate. + A keyframe track is generated for each component that you insert keyframes + for. + + \image studio-timeline-with-empty-tracks.png "Timeline view with a property" + + You can now select \inlineimage local_record_keyframes.png + to \l{Setting Keyframe Values}{record changes} in component properties + while you \l{Navigating in Timeline}{navigate the timeline}. + + The following video shows how to insert keyframes for component properties + and to animate them in \uicontrol Timeline: + + \youtube V3Po15bNErw + + \if defined(qtdesignstudio) + To try it yourself, follow the \l{Log In UI - Part 4} tutorial. + \endif + + + For more information about creating timeline animations, see + \l{Creating Animations}. + + \section1 Navigating in Timeline + + \image studio-timeline.png "Timeline view" + + You can navigate the timeline in the following ways: + + \list + \li Drag the playhead (1) to a frame. + \li Click on the ruler (2) to move to a frame. + \li Select the \uicontrol {To Start (Home)}, \uicontrol {Previous (,)}, + \uicontrol {Next (.)}, or \uicontrol {To End (End)} buttons (3), or + use the keyboard shortcuts to move to the first, previous, next, or + last frame on the timeline. + \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. + \endlist + + \section1 Zooming in Timeline + + Use the slider on the toolbar to set the zooming level in the + \uicontrol Timeline view. Select the \inlineimage zoom_small.png + and \inlineimage zoom_big.png + buttons to zoom out of or into the view. + + \section1 Setting Keyframe Track Color + + To change the color of a keyframe track, select \uicontrol {Override Color} + in the context menu, and then select a color in the \l{Picking Colors} + {color picker}. To reset the color, select \uicontrol {Reset Color}. + + \image studio-timeline-keyframe-track-colors.png "Keyframe track colors in Timeline" + + \section1 Timeline Toolbar + + The \uicontrol Timeline toolbar contains the following buttons and fields. + + \table + \header + \li Button/Field + \li Action + \li Read More + \row + \li \inlineimage animation.png + \li Opens the \uicontrol {Timeline Settings} dialog for editing + timeline settings. + \li \l{Creating Timelines} + \row + \li Timeline ID + \li Displays the ID of the current timeline. + \li \l{Creating Timelines} + \row + \li \inlineimage to_first_frame.png + \li \uicontrol {To Start (Home)} moves to the first frame on the + timeline. + \li \l{Navigating in Timeline} + \row + \li \inlineimage back_one_frame.png + \li \uicontrol {Previous (,)} moves to the previous frame on the + timeline. + \li \l{Navigating in Timeline} + \row + \li \inlineimage start_playback.png + \li \uicontrol {Play (Space)} previews the animation. + \li \l{Viewing the Animation} + \row + \li \inlineimage forward_one_frame.png + \li \uicontrol {Next (.)} moves to the next frame on the timeline. + \li \l{Navigating in Timeline} + \row + \li \inlineimage to_last_frame.png + \li \uicontrol {To End (End)} moves to the last frame on the timeline. + \li \l{Navigating in Timeline} + \row + \li Current Keyframe + \li Displays the frame that the playhead is currently on. Enter a + number in the field to move the playhead to the respective frame. + \li \l{Navigating in Timeline} + \row + \li \inlineimage global_record_keyframes.png + \li Records changes in keyframe values. + \li \l {Setting Keyframe Values} + \row + \li \inlineimage curve_editor.png + \li Opens \uicontrol {Easing Curve Editor} for attaching an easing + curve to the selected transition. + \li \l{Editing Easing Curves} + \row + \li Start Frame + \li Specifies the first frame of the timeline. Negative values are + allowed. The difference between the start frame and the end frame + determines the duration of the animation. + \li \l{Creating Timelines} + \row + \li \inlineimage zoom_small.png + \li \uicontrol {Zoom Out} (\key Ctrl+-) zooms out of the view. + \li \l{Zooming in Timeline} + \row + \li Slider + \li Sets the zooming level. + \li \l{Zooming in Timeline} + \row + \li \inlineimage zoom_big.png + \li \uicontrol {Zoom In} (\key Ctrl++) zooms into the view. + \li \l{Zooming in Timeline} + \row + \li End Frame + \li Specifies the last frame of the timeline. The difference between + the start frame and the end frame determines the duration of the + animation, so if the start frame is 0, the end frame equals the + duration. + \li \l{Creating Timelines} + \row + \li State Name + \li Displays the name of the current state. + \li \l{Binding Animations to States} + \endtable + + \section1 Keyframe Track Icons + + Each keyframe track can contain the following buttons and markers. + + \table + \header + \li Button/Icon + \li Action + \li Read More + \row + \li \inlineimage previous_keyframe.png + \li Jumps to the previous frame on the timeline. + \li \l{Setting Keyframe Values} + \row + \li \inlineimage next_keyframe.png + \li Jumps to the next frame on the timeline. + \li \l{Setting Keyframe Values} + \row + \li \inlineimage local_record_keyframes.png + \li Records changes in keyframe values for a particular property. + \li \l {Setting Keyframe Values} + \target keyframe_marker + \row + \li \inlineimage keyframe.png + \li Indicates the type of easing curve attached to the keyframe. + When a keyframe track is selected, the keyframe markers on it turn + gray, and when a keyframe itself is selected, its marker turns + brown: + \list + \li \inlineimage keyframe_linear_inactive.png + - linear easing curve + \li \inlineimage keyframe_manualbezier_inactive.png + - manually set Bezier curve + \li \inlineimage keyframe_autobezier_inactive.png + - automatically set Bezier curve + \li \inlineimage keyframe_lineartobezier_inactive.png + - linear-to-Bezier curve + \endlist + \li \l {Editing Easing Curves} + \endtable + + \section1 Timeline Context Menu + + The following table summarizes the context menu items available for each + keyframe track for a component, property, or keyframe marker and provides + links to more information about them. + + \table + \header + \li To Learn About + \li Go To + \row + \li Delete All Keyframes + \li \l{Deleting Keyframes} + \row + \li Add Keyframes at Current Frame + \li \l{Setting Keyframe Values} + \row + \li Copy All Keyframes + \li \l{Copying Keyframes} + \row + \li Paste Keyframes + \li \l{Copying Keyframes} + \row + \li Remove Property + \li \l{Setting Keyframe Values} + \row + \li Delete Keyframe + \li \l{Deleting Keyframes} + \row + \li Edit Easing Curve + \li \l{Editing Easing Curves} + \row + \li Edit Keyframe + \li \l{Editing Keyframe Values} + \row + \li Override Color + \li \l{Setting Keyframe Track Color} + \row + \li Reset Color + \li \l{Setting Keyframe Track Color} + \endtable +*/ diff --git a/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc b/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc index dca62b7fc98..418a68cad63 100644 --- a/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-timeline.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Creator documentation. @@ -30,21 +30,39 @@ \title Creating Animations - You can use the timeline and keyframe based editor in the - \uicontrol Timeline view to animate the properties of UI components. + Animation is based on \e keyframes. In \QC, keyframes determine the value + of the property of a \l{glossary_component}{component} at a certain time. Animating properties enables their values to move through intermediate - values instead of immediately changing to the target value. For example, - to move an item in a scene, you can animate the properties that control - the item's position, x and y, so that the item's position changes at - keyframes on the way to the target position. Similarly, you could change - the color and scale properties of the item at keyframes to make it appear - to move closer or farther away. + values instead of immediately changing to the target value. - Qt Quick allows you to declare various UI states in \l State objects. - These states are comprised of property changes from a base state, and - can be a useful way of organizing your UI logic. Transitions are objects - you can associate with an item to define how its properties will animate - when they change due to a state change. + For example, you can set the y position property of a rectangle to 0 at the + start of your animation and to 100 at the end of the animation. When the + animation is run, the rectangle moves from position 0 to 100 on the y axis. + In the middle of the animation, the y property has the value of 50 since + keyframes are interpolated linearly by default. + + Sometimes you don't want linear movement but would rather like the rectangle + to move faster at the beginning and slower at the end of the animation. + To achieve this effect, you could insert a lot keyframes between the start + frame and the end frame. To avoid this effort, you can use the + \l{Editing Easing Curves}{Easing Curve Editor} to specify \e {easing curves} + for nonlinear interpolation between keyframes. The easing curves can make + components appear to pick up speed, slow down, or bounce back at the end of + the animation. + + While easing curves work well for most simple UI animations, more complex + 3D animations require several keyframes so it becomes necessary to visualize + the value and the interpolation of a keyframe simultaneously. The + \l {Curve Editor} visualizes the whole animation of a property at once and + shows the effective values of a keyframe together with the interpolation + between keyframes. It can also show animations of different properties + simultaneously so that you can see the animation for the x position + side-by-side with the animation of the y position. + + You can declare various UI states as \l{Adding States}{states}, which + are specified as changes from a base state and can be a useful way of + organizing your UI logic. You can \l{Binding Animations to States} + {bind animations to states} to run an animation when a state is applied. Each component in a scene or a project can have its own timeline and its own set of states. We recommend that you place your timelines inside the @@ -55,9 +73,10 @@ timelines to your components will increase the file size and runtime memory requirements of your UI. - You can find a video tutorial about creating timelines and adding keyframes - \l{https://resources.qt.io/development-topic-ui-design/qtdesignstudio-clustertutorial-parttwo} - {here}. + The following video shows how to animate component properties using the + timeline and keyframe based editor in the \l Timeline view: + + \youtube V3Po15bNErw \if defined(qtcreator) To be able to create timelines, you also need the \l {Qt Quick Timeline} @@ -76,26 +95,28 @@ To create a timeline to animate a UI component: \list 1 - \li In the \uicontrol Navigator, select the item to animate. - \li In the \uicontrol Timeline view, select the \inlineimage plus.png + \li In the \l 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. - \li In the \uicontrol {Timeline ID} field, enter a name that describes - the animated item. - \li In the \uicontrol {End frame} field, set the duration of the - animation. + \li In the \uicontrol {Timeline ID} field, enter an ID that describes + the animated component. + \li In the \uicontrol {Start frame} field, set the first frame of the + timeline. Negative values are allowed. + \li In the \uicontrol {End frame} field, set the last frame of the + timeline. \li To use bindings to specify the properties, select the \uicontrol {Expression binding} radio button and enter the binding in the \uicontrol {Expression binding} field. For more information about property binding, see \l{Setting Bindings}. \li To create a timeline animation, select the \uicontrol Animation radio button. - \li In the \uicontrol timelineAnimation tab, \uicontrol {Animation ID} - field, enter a name for the animation. - \li Select the \uicontrol {Running in Base State} check box to use the - settings in this tab when previewing the UI. Deselect the check box - to use the default settings. + \li In the \uicontrol {Animation ID} field, enter an ID for the + animation. + \li Select the \uicontrol {Running in Base State} check box to run the + animation when the base state is applied. Deselect the check box + if you want to run the animation when some other state is applied. + For more information, see \l{Binding Animations to States}. \li In the \uicontrol {Start frame} field, set the first frame of the animation. \li In the \uicontrol {End frame} field, set the last frame of the @@ -111,25 +132,26 @@ means that you must restart the animation to see it again \li Select the \uicontrol {Ping pong} check box to play the animation backwards back to the beginning when it reaches the end. - \li In the \uicontrol {Transitions to states} field, select the state - to switch to when the animation finishes. + \li In the \uicontrol Finished field, select the state + to apply when the animation finishes. \li Select \uicontrol Close to close the dialog and save the settings. \endlist To create additional timelines, select the \inlineimage plus.png - (\uicontrol {Add Timeline}) button next to the \uicontrol timeline tab. + (\uicontrol {Add Timeline}) button next to the + \uicontrol {Timeline Settings} tab. - To specify settings for running the timeline animations, select the + To specify settings for running timeline animations, select the \inlineimage plus.png (\uicontrol {Add Animation}) button next to the - \uicontrol {Animation Settings} group. For example, you could create + \uicontrol {Animation Settings} tab. For example, you could create settings for running a part of the timeline animation between specified frames or for running the animation backwards from the last frame to the first. To modify the settings, select the \inlineimage animation.png - (\uicontrol {Timeline Settings (S)}) button on the toolbar - (or press \key S) in the \uicontrol Timeline view. + (\uicontrol {Timeline Settings (S)}) button on the \l{Timeline Toolbar} + {toolbar} (or press \key S) in the \l Timeline view. \section2 Binding Animations to States @@ -141,38 +163,21 @@ \section1 Managing Keyframes - To animate components in the \uicontrol Timeline view, move to a frame + To animate components in the \l Timeline view, move to a frame on the timeline and specify changes in the values of a property. \QC - automatically adds keyframes between two keyframes, and sets their values + automatically adds keyframes between two keyframes and sets their values evenly to create an appearance of movement or transformation. - \section2 Navigating the Timeline - - \image studio-timeline.png "Timeline view" - - You can navigate the timeline in the following ways: - - \list - \li Drag the playhead (1) to a frame. - \li Click on the ruler (2) to move to a frame. - \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 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. - \endlist + \image studio-timeline-with-tracks.png "Timeline view" \section2 Setting Keyframe Values You can insert keyframes for all the properties of all the components that you want to animate first, and then record the changes in their values by - selecting the \inlineimage recordfill.png + selecting the \inlineimage local_record_keyframes.png (\uicontrol {Per Property Recording}) button for one property at a time. - For example, you can hide and show items by turning their visibility off and - on or by setting their opacity to 0 or 1. + For example, you can hide and show components by turning their visibility + off and on or by setting their opacity to 0 or 1. You can also select the \uicontrol {Auto Key (K)} button (or press \key K) to record changes in property values, but you need to be more careful about @@ -181,17 +186,19 @@ To record the changes of property values: \list 1 - \li In the \uicontrol Navigator, select the item to animate. - \li In the \uicontrol Properties view, select \uicontrol Settings > + \li In the \l Navigator view, select the component to animate. + \li In the \l Properties view, select \uicontrol Settings > \uicontrol {Insert Keyframe} for the property that you want to animate. - \li Select the \uicontrol {Per Property Recording} button to start - recording property changes. + \li In the \l Timeline view, select the + \uicontrol {Per Property Recording} button + to start recording property changes. \li Check that the playhead is in frame 0 and enter the value of the property in the field next to the property name on the timeline. Press \key Enter to save the value. \li Move the playhead to another frame on the timeline and specify - the value at that frame. + the value at that frame. For more information, see + \l{Navigating in Timeline}. \li When you have specified as many values as you need, select \uicontrol {Per Property Recording} again to stop recording. \endlist @@ -199,32 +206,42 @@ To remove all the changes you recorded for a property, right-click the property name on the timeline and select \uicontrol {Remove Property}. - Keyframes are marked on the timeline by using markers of different colors and - shapes, depending on whether they are active or inactive or whether you have - applied easing curves to them, for example. + To add keyframes to the keyframe track of a component at the current + position of the playhead, select \uicontrol {Add Keyframes at Current Frame}. - To edit the value of a keyframe, double-click a keyframe marker or select - \uicontrol {Edit Keyframe} in the context menu. In the \uicontrol Frame - field, you can set the frame and the value: + Keyframes are marked on the timeline by using \l{keyframe_marker}{markers} + of different colors and shapes, depending on whether they are active or + inactive or whether you have applied \l{Editing Easing Curves} + {easing curves} to them. + + \section2 Editing Keyframe Values + + To fine-tune the value of a keyframe, double-click a keyframe marker or + select \uicontrol {Edit Keyframe} in the context menu. + + The \uicontrol {Edit Keyframe} dialog displays the name of the property + you are animating and its current value at the frame specified in the + \uicontrol Frame field. You can change both the keyframe and its value. \image studio-edit-keyframe.png "Edit Keyframe dialog" - You can copy the keyframes from the keyframe track for an item and - paste them to the keyframe track of another item. To copy all - keyframes from one item to another one, select an item, and then - select \uicontrol {Copy All Keyframes} in the context menu. Then - select the other item and select \uicontrol {Paste Keyframes} in - the context menu. + \section2 Copying Keyframes + + You can copy the keyframes from the keyframe track for a component and + paste them to the keyframe track of another component. To copy all + keyframes from one track to another one, first right-click the component ID + and select \uicontrol {Copy All Keyframes} in the context menu. + Then right-click the other component ID, and select + \uicontrol {Paste Keyframes} in the context menu. + + \section2 Deleting Keyframes To delete the selected keyframe, select \uicontrol {Delete Keyframe} in the context menu. - To delete all keyframes from the selected item, select + To delete all keyframes from the selected component, select \uicontrol {Delete All Keyframes} in the context menu. - To add keyframes to the keyframe track of an item at the current position - of the playhead select \uicontrol {Add Keyframes at Current Frame}. - \section1 Viewing the Animation You can view the animation on the canvas by moving the playhead along the @@ -236,109 +253,11 @@ (\uicontrol {Show Live Preview}) button on the canvas toolbar or press \key {Alt+P}. - \section1 Editing Easing Curves - - \e Easing specifies the rate of a property value over time, so that - components can appear to pick up speed, slow down, or bounce back at the - end of the animation. By default, the animations you specify on the - 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} to edit the curves for the whole - animation. - - \section2 Attaching Easing Curves to Keyframes - - \image studio-easing-curve-editor.png "Easing Curve Editor" - - You can use the preset curves or modify them by dragging the curve handlers - around. You can add points to the curve and drag them and the point handlers - to modify the curve. When you are happy with the curve, you can save it as a - custom curve. For more information about easing curve types, see the - documentation for \l [QML] {PropertyAnimation}{easing curves}. - - To zoom into and out of the easing curve editor, use the mouse roller. To - reset the zoom factor, right-click in the picker and select - \uicontrol {Reset Zoom}. - - To attach easing curves to keyframes: - - \list 1 - \li Right-click a keyframe on the timeline and select - \uicontrol {Easing Curve Editor} in the context menu. - \li Select an easing curve in the \uicontrol Presets tab. - \li In the \uicontrol {Duration (ms)} field, select the duration of the - easing function in milliseconds. - \li Select \uicontrol Preview to preview the curve. - \li Select \uicontrol OK to attach the easing curve to the keyframe - and to close the easing curve editor. - \endlist - - When you attach easing curves to keyframes, the shape of the keyframe - marker changes from \inlineimage keyframe_linear_inactive.png - to \inlineimage keyframe_manualbezier_inactive.png - . - - \section2 Customizing Easing Curves - - To customize easing curves: - - \list 1 - \li In \uicontrol {Easing Curve Editor}, select an easing curve in - the \uicontrol Presets tab. - \li Drag the curve handlers to modify the curve. - \li Right-click in the editor, and select \uicontrol {Add Point} to add - points to the curve. - \li Drag the points or the point handlers to modify the curve. If the - curve becomes invalid, it turns red in the editor and the - \uicontrol Save button is disabled. - \li Select \uicontrol Save to save your changes to the curve. - \li In the \uicontrol Name field, enter a name for the custom curve, - and then select \uicontrol OK to save the curve in the - \uicontrol Custom tab. - \endlist - - To paste easing curve definitions to \uicontrol {Easing Curve Editor} as - text, select the \uicontrol Text tab. - - \section1 Editing Animation Curves - - In \uicontrol {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 in - \uicontrol {Easing Curve Editor}. If the item that - contains the easing curves has been locked in - \uicontrol Navigator, you can select \inlineimage icons/lockon.png - to unlock it. You can also lock individual easing curves for editing. - - \image studio-curve-editor.png "Curve Editor" - - To edit animation curves: - - \list 1 - \li In the \uicontrol Timeline view, insert at least one keyframe. - \li Select \uicontrol View > \uicontrol Views > - \uicontrol {Curve Editor} 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. - \li To lock an easing curve, hover the mouse over the keyframe in the - list, and then select the lock icon. - \li To pin an easing curve, hover the mouse over the keyframe in the - list, and then select the pin icon. - \endlist - - Your changes are automatically saved when you close the view. - - \section1 Rotating Items + \section1 Animating Rotation To animate components that rotate around a central point, you can use the - \l {basic-item}{Item} QML type as a parent for the rotating component. Then - create a timeline for the Item and set the rotation property for the start + \l {basic-item}{Item} component as a parent for the rotating component. Then + create a timeline for the Item, and set the rotation property for the start and end keyframes. \if defined(qtdesignstudio) diff --git a/doc/qtdesignstudio/examples/doc/loginui3.qdoc b/doc/qtdesignstudio/examples/doc/loginui3.qdoc index a0bc1d2294f..56a76bb73b2 100644 --- a/doc/qtdesignstudio/examples/doc/loginui3.qdoc +++ b/doc/qtdesignstudio/examples/doc/loginui3.qdoc @@ -186,7 +186,7 @@ is clicked within the area. You will now use the \uicontrol Connections view to - \l{Connecting Objects to Signals}{connect} the clicked signal of + \l{Connecting Components to Signals}{connect} the clicked signal of \e registerButton to \e registerState and that of \e backButton to \e loginState: diff --git a/doc/qtdesignstudio/examples/doc/sidemenu.qdoc b/doc/qtdesignstudio/examples/doc/sidemenu.qdoc index acc13538b81..ff69b48febf 100644 --- a/doc/qtdesignstudio/examples/doc/sidemenu.qdoc +++ b/doc/qtdesignstudio/examples/doc/sidemenu.qdoc @@ -205,8 +205,8 @@ The side menu is fully visible and accepts input only in the \e open state. - For more information about connecting objects to signals, see - \l {Connecting Objects to Signals}. + For more information about Connecting Components to Signals, see + \l {Connecting Components to Signals}. \section1 Applying Effects diff --git a/doc/qtdesignstudio/examples/doc/washingMachineUI.qdoc b/doc/qtdesignstudio/examples/doc/washingMachineUI.qdoc index 2bd8e7538b1..ed1d079fb3e 100644 --- a/doc/qtdesignstudio/examples/doc/washingMachineUI.qdoc +++ b/doc/qtdesignstudio/examples/doc/washingMachineUI.qdoc @@ -46,7 +46,7 @@ \endlist Users select buttons to navigate between the screens. - We use \l{Connecting Objects to Signals}{connections} to determine which + We use \l{Connecting Components to Signals}{connections} to determine which screen to open when users select a particular button and \l{Adding States} {States} to show the screens. We use the \l{Creating Animations}{timeline} to create progress indicators for buttons and the \e Running screen. @@ -234,7 +234,7 @@ We create similar connections between button objects and signals in the other screens to apply other actions that move users to other screens. - For more information, see \l {Connecting Objects to Signals}. + For more information, see \l {Connecting Components to Signals}. \section1 Showing the Current Time diff --git a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc index 3fad0989341..d1461f8e2f4 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc @@ -62,7 +62,11 @@ \li \l{Library} \li \l{Navigator} \li \l{Properties} + \li \l{Connection View} + \li \l{States} \li \l{Transition Editor} + \li \l{Timeline} + \li \l{Curve Editor} \endlist \li \l{Managing Workspaces} \li \l{Managing Sessions} @@ -110,11 +114,14 @@ \li \l {Adding Dynamics} \list \li \l{Creating Animations} + \list + \li \l{Editing Easing Curves} + \endlist \li \l{Adding Connections} \list - \li\l{Connecting Objects to Signals} - \li\l{Specifying Dynamic Properties} + \li\l{Connecting Components to Signals} \li\l{Adding Bindings Between Properties} + \li\l{Specifying Dynamic Properties} \endlist \li \l{Adding States} \endlist diff --git a/qbs/modules/qtc/qtc.qbs b/qbs/modules/qtc/qtc.qbs index ba79c2cb138..b14dcc1a78b 100644 --- a/qbs/modules/qtc/qtc.qbs +++ b/qbs/modules/qtc/qtc.qbs @@ -16,7 +16,7 @@ Module { property string qtcreator_compat_version: ide_compat_version_major + '.' + ide_compat_version_minor + '.' + ide_compat_version_release - property string qtcreator_copyright_year: '2020' + property string qtcreator_copyright_year: '2021' property string qtcreator_copyright_string: "(C) " + qtcreator_copyright_year + " The Qt Company Ltd" property string ide_display_name: 'Qt Creator' diff --git a/qtcreator_ide_branding.pri b/qtcreator_ide_branding.pri index 65255c343b9..5fc13f89649 100644 --- a/qtcreator_ide_branding.pri +++ b/qtcreator_ide_branding.pri @@ -1,7 +1,7 @@ QTCREATOR_VERSION = 4.15.82 QTCREATOR_COMPAT_VERSION = 4.15.82 QTCREATOR_DISPLAY_VERSION = 4.16.0-beta1 -QTCREATOR_COPYRIGHT_YEAR = 2020 +QTCREATOR_COPYRIGHT_YEAR = 2021 IDE_DISPLAY_NAME = Qt Creator IDE_ID = qtcreator diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp index ac172f4078a..e5890ac2edf 100644 --- a/src/libs/utils/projectintropage.cpp +++ b/src/libs/utils/projectintropage.cpp @@ -165,16 +165,15 @@ bool ProjectIntroPage::validate() return false; } - // Name valid? Ignore 'DisplayingPlaceholderText' state. - bool nameValid = false; + // Name valid? switch (d->m_ui.nameLineEdit->state()) { case FancyLineEdit::Invalid: displayStatusMessage(InfoLabel::Error, d->m_ui.nameLineEdit->errorMessage()); return false; case FancyLineEdit::DisplayingPlaceholderText: - break; + displayStatusMessage(InfoLabel::Error, tr("Name is empty.")); + return false; case FancyLineEdit::Valid: - nameValid = true; break; } @@ -183,12 +182,12 @@ bool ProjectIntroPage::validate() + QDir::fromNativeSeparators(d->m_ui.nameLineEdit->text())); if (!projectDirFile.exists()) { // All happy hideStatusLabel(); - return nameValid; + return true; } if (projectDirFile.isDir()) { displayStatusMessage(InfoLabel::Warning, tr("The project already exists.")); - return nameValid; + return true; } // Not a directory, but something else, likely causing directory creation to fail displayStatusMessage(InfoLabel::Error, tr("A file with that name already exists.")); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 7b2d8eb5690..84ded757958 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -463,8 +463,14 @@ void CMakeBuildSettingsWidget::batchEditConfiguration() connect(buttons, &QDialogButtonBox::accepted, dialog, &QDialog::accept); connect(buttons, &QDialogButtonBox::rejected, dialog, &QDialog::reject); connect(dialog, &QDialog::accepted, this, [=]{ - const CMakeConfig config = CMakeConfigItem::itemsFromArguments( - editor->toPlainText().split('\n', Qt::SkipEmptyParts)); + const auto expander = m_buildConfiguration->macroExpander(); + + const QStringList lines = editor->toPlainText().split('\n', Qt::SkipEmptyParts); + const QStringList expandedLines = Utils::transform(lines, + [expander](const QString &s) { + return expander->expand(s); + }); + const CMakeConfig config = CMakeConfigItem::itemsFromArguments(expandedLines); m_configModel->setBatchEditConfiguration(config); }); diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp index ed53c8191e0..044d1ab3728 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp @@ -447,8 +447,9 @@ bool CMakeBuildSystem::mustApplyExtraArguments(const BuildDirParameters ¶met auto answer = QMessageBox::question(Core::ICore::mainWindow(), tr("Apply configuration changes?"), - tr("Run CMake with \"%1\"?") - .arg(parameters.extraCMakeArguments.join(" ")), + "

" + tr("Run CMake with configuration changes?") + + "

"
+                                            + parameters.extraCMakeArguments.join("\n") + "
", QMessageBox::Apply | QMessageBox::Discard, QMessageBox::Apply); return answer == QMessageBox::Apply; diff --git a/src/plugins/cmakeprojectmanager/fileapireader.cpp b/src/plugins/cmakeprojectmanager/fileapireader.cpp index 0657782c980..ae3725e4a8c 100644 --- a/src/plugins/cmakeprojectmanager/fileapireader.cpp +++ b/src/plugins/cmakeprojectmanager/fileapireader.cpp @@ -253,7 +253,7 @@ void FileApiReader::endState(const QFileInfo &replyFi) const FilePath sourceDirectory = m_parameters.sourceDirectory; const FilePath buildDirectory = m_parameters.workDirectory; const FilePath topCmakeFile = m_cmakeFiles.size() == 1 ? *m_cmakeFiles.begin() : FilePath{}; - const QString cmakeBuildType = m_parameters.cmakeBuildType; + const QString cmakeBuildType = m_parameters.cmakeBuildType == "Build" ? "" : m_parameters.cmakeBuildType; m_lastReplyTimestamp = replyFi.lastModified(); diff --git a/src/plugins/fakevim/CMakeLists.txt b/src/plugins/fakevim/CMakeLists.txt index a7c1cf736c4..96678f3e3b8 100644 --- a/src/plugins/fakevim/CMakeLists.txt +++ b/src/plugins/fakevim/CMakeLists.txt @@ -1,4 +1,5 @@ add_qtc_plugin(FakeVim + CONDITION Qt5_VERSION VERSION_LESS 6.0.0 PLUGIN_DEPENDS Core TextEditor PLUGIN_TEST_DEPENDS CppEditor CppTools SOURCES ${TEST_SOURCES} diff --git a/src/plugins/projectexplorer/clangparser.cpp b/src/plugins/projectexplorer/clangparser.cpp index dcf935b2db9..8409d788322 100644 --- a/src/plugins/projectexplorer/clangparser.cpp +++ b/src/plugins/projectexplorer/clangparser.cpp @@ -142,6 +142,25 @@ void ProjectExplorerPlugin::testClangOutputParser_data() QTest::addColumn("tasks"); QTest::addColumn("outputLines"); + auto compileTask = [](Task::TaskType type, + const QString &description, + const Utils::FilePath &file, + int line, + const QVector formats) + { + CompileTask task(type, description, file, line); + task.formats = formats; + return task; + }; + + auto formatRange = [](int start, int length, const QString &anchorHref = QString()) + { + QTextCharFormat format; + format.setAnchorHref(anchorHref); + + return QTextLayout::FormatRange{start, length, format}; + }; + QTest::newRow("pass-through stdout") << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT << QString::fromLatin1("Sometext\n") << QString() @@ -179,7 +198,7 @@ void ProjectExplorerPlugin::testClangOutputParser_data() " ^") << OutputParserTester::STDERR << QString() << QString() - << Tasks{CompileTask( + << Tasks{compileTask( Task::Warning, "unknown attribute 'dllimport' ignored [-Wunknown-attributes]\n" "In file included from ..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qnamespace.h:45:\n" @@ -187,7 +206,9 @@ void ProjectExplorerPlugin::testClangOutputParser_data() "class Q_CORE_EXPORT QSysInfo {\n" " ^", FilePath::fromUserInput("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qglobal.h"), - 1425)} + 1425, + QVector() + << formatRange(61, 278))} << QString(); QTest::newRow("note") @@ -197,13 +218,15 @@ void ProjectExplorerPlugin::testClangOutputParser_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Unknown, + << compileTask(Task::Unknown, "instantiated from:\n" "..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qglobal.h:1289:27: note: instantiated from:\n" "# define Q_CORE_EXPORT Q_DECL_IMPORT\n" " ^", FilePath::fromUserInput("..\\..\\..\\QtSDK1.1\\Desktop\\Qt\\4.7.3\\mingw\\include/QtCore/qglobal.h"), - 1289)) + 1289, + QVector() + << formatRange(19, 167))) << QString(); QTest::newRow("fatal error") @@ -213,13 +236,17 @@ void ProjectExplorerPlugin::testClangOutputParser_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Error, + << compileTask(Task::Error, "'bits/c++config.h' file not found\n" "/usr/include/c++/4.6/utility:68:10: fatal error: 'bits/c++config.h' file not found\n" "#include \n" " ^", FilePath::fromUserInput("/usr/include/c++/4.6/utility"), - 68)) + 68, + QVector() + << formatRange(34, 0) + << formatRange(34, 28, "olpfile:///usr/include/c++/4.6/utility::68::-1") + << formatRange(62, 93))) << QString(); QTest::newRow("line confusion") @@ -229,13 +256,17 @@ void ProjectExplorerPlugin::testClangOutputParser_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Warning, + << compileTask(Task::Warning, "?: has lower precedence than +; + will be evaluated first [-Wparentheses]\n" "/home/code/src/creator/src/plugins/coreplugin/manhattanstyle.cpp:567:51: warning: ?: has lower precedence than +; + will be evaluated first [-Wparentheses]\n" " int x = option->rect.x() + horizontal ? 2 : 6;\n" " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^", FilePath::fromUserInput("/home/code/src/creator/src/plugins/coreplugin/manhattanstyle.cpp"), - 567)) + 567, + QVector() + << formatRange(74, 0) + << formatRange(74, 64, "olpfile:///home/code/src/creator/src/plugins/coreplugin/manhattanstyle.cpp::567::-1") + << formatRange(138, 202))) << QString(); QTest::newRow("code sign error") diff --git a/src/plugins/projectexplorer/gccparser.cpp b/src/plugins/projectexplorer/gccparser.cpp index 3daf1f56e25..33f820a34f1 100644 --- a/src/plugins/projectexplorer/gccparser.cpp +++ b/src/plugins/projectexplorer/gccparser.cpp @@ -271,6 +271,25 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() QTest::addColumn("tasks"); QTest::addColumn("outputLines"); + auto compileTask = [](Task::TaskType type, + const QString &description, + const Utils::FilePath &file, + int line, + const QVector formats) + { + CompileTask task(type, description, file, line); + task.formats = formats; + return task; + }; + + auto formatRange = [](int start, int length, const QString &anchorHref = QString()) + { + QTextCharFormat format; + format.setAnchorHref(anchorHref); + + return QTextLayout::FormatRange{start, length, format}; + }; + QTest::newRow("pass-through stdout") << QString::fromLatin1("Sometext") << OutputParserTester::STDOUT << QString::fromLatin1("Sometext\n") << QString() @@ -296,12 +315,18 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Error, + << compileTask(Task::Error, "`sfasdf' undeclared (first use this function)\n" "/temp/test/untitled8/main.cpp: In function `int main(int, char**)':\n" "/temp/test/untitled8/main.cpp:9: error: `sfasdf' undeclared (first use this function)", FilePath::fromUserInput("/temp/test/untitled8/main.cpp"), - 9) + 9, + QVector() + << formatRange(46, 0) + << formatRange(46, 29, "olpfile:///temp/test/untitled8/main.cpp::0::-1") + << formatRange(75, 39) + << formatRange(114, 29, "olpfile:///temp/test/untitled8/main.cpp::9::-1") + << formatRange(143, 56)) << CompileTask(Task::Error, "(Each undeclared identifier is reported only once for each function it appears in.)", FilePath::fromUserInput("/temp/test/untitled8/main.cpp"), @@ -364,6 +389,14 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() 8)) << QString(); + QVector formatRanges; + if (HostOsInfo::isWindowsHost()) { + formatRanges << formatRange(51, 28) + << formatRange(79, 31, "olpfile://C:/temp/test/untitled8/main.cpp::8::-1") + << formatRange(110, 54); + } else { + formatRanges << formatRange(51, 113); + } QTest::newRow("Undefined reference (debug)") << QString::fromLatin1("main.o: In function `main':\n" "C:\\temp\\test\\untitled8/main.cpp:8: undefined reference to `MainWindow::doSomething()'\n" @@ -371,16 +404,25 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Error, + << compileTask(Task::Error, "undefined reference to `MainWindow::doSomething()'\n" "main.o: In function `main':\n" "C:\\temp\\test\\untitled8/main.cpp:8: undefined reference to `MainWindow::doSomething()'", FilePath::fromUserInput("C:\\temp\\test\\untitled8/main.cpp"), - 8) + 8, + formatRanges) << CompileTask(Task::Error, "collect2: ld returned 1 exit status")) << QString(); + formatRanges.clear(); + if (HostOsInfo::isWindowsHost()) { + formatRanges << formatRange(51, 28) + << formatRange(79, 31, "olpfile://C:/temp/test/untitled8/main.cpp::0::-1") + << formatRange(110, 65); + } else { + formatRanges << formatRange(51, 124); + } QTest::newRow("Undefined reference (release)") << QString::fromLatin1("main.o: In function `main':\n" "C:\\temp\\test\\untitled8/main.cpp:(.text+0x40): undefined reference to `MainWindow::doSomething()'\n" @@ -388,11 +430,13 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Error, + << compileTask(Task::Error, "undefined reference to `MainWindow::doSomething()'\n" "main.o: In function `main':\n" "C:\\temp\\test\\untitled8/main.cpp:(.text+0x40): undefined reference to `MainWindow::doSomething()'", - FilePath::fromUserInput("C:\\temp\\test\\untitled8/main.cpp")) + FilePath::fromUserInput("C:\\temp\\test\\untitled8/main.cpp"), + -1, + formatRanges) << CompileTask(Task::Error, "collect2: ld returned 1 exit status")) << QString(); @@ -423,12 +467,14 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Warning, + << compileTask(Task::Warning, "unused variable 'index'\n" "../../../../master/src/plugins/debugger/gdb/gdbengine.cpp: In member function 'void Debugger::Internal::GdbEngine::handleBreakInsert2(const Debugger::Internal::GdbResponse&)':\n" "../../../../master/src/plugins/debugger/gdb/gdbengine.cpp:2114: warning: unused variable 'index'", FilePath::fromUserInput("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp"), - 2114) + 2114, + QVector() + << formatRange(24, 272)) << CompileTask(Task::Warning, "unused variable 'handler'", FilePath::fromUserInput("../../../../master/src/plugins/debugger/gdb/gdbengine.cpp"), @@ -442,12 +488,18 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Error, + << compileTask(Task::Error, "expected primary-expression before ':' token\n" "/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp: In member function 'void ProjectExplorer::ProjectExplorerPlugin::testGnuMakeParserTaskMangling_data()':\n" "/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp:264: error: expected primary-expression before ':' token", FilePath::fromUserInput("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp"), - 264) + 264, + QVector() + << formatRange(45, 0) + << formatRange(45, 68, "olpfile:///home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp::0::-1") + << formatRange(113, 106) + << formatRange(219, 68, "olpfile:///home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp::264::-1") + << formatRange(287, 57)) << CompileTask(Task::Error, "expected ';' before ':' token", FilePath::fromUserInput("/home/code/src/creator/src/plugins/projectexplorer/gnumakeparser.cpp"), @@ -505,12 +557,18 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Warning, + << compileTask(Task::Warning, "suggest explicit braces to avoid ambiguous 'else'\n" "/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c: In static member function 'static std::_Rb_tree_node_base* std::_Rb_global<_Dummy>::_Rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*&, std::_Rb_tree_node_base*&, std::_Rb_tree_node_base*&)':\n" "/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c:194: warning: suggest explicit braces to avoid ambiguous 'else'", FilePath::fromUserInput("/Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c"), - 194)) + 194, + QVector() + << formatRange(50, 0) + << formatRange(50, 67, "olpfile:///Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c::0::-1") + << formatRange(117, 216) + << formatRange(333, 67, "olpfile:///Qt/4.6.2-Symbian/s60sdk/epoc32/include/stdapis/stlport/stl/_tree.c::194::-1") + << formatRange(400, 64))) << QString(); QTest::newRow("rm false positive") @@ -536,11 +594,14 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Unknown, + << compileTask(Task::Unknown, "In function void foo(i) [with i = double]:\n" "../../scriptbug/main.cpp: In function void foo(i) [with i = double]:\n" "../../scriptbug/main.cpp:22: instantiated from here", - FilePath::fromUserInput("../../scriptbug/main.cpp")) + FilePath::fromUserInput("../../scriptbug/main.cpp"), + -1, + QVector() + << formatRange(43, 120)) << CompileTask(Task::Warning, "unused variable c", FilePath::fromUserInput("../../scriptbug/main.cpp"), @@ -577,12 +638,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Unknown, + << compileTask(Task::Unknown, "At global scope:\n" "../../scriptbug/main.cpp: At global scope:\n" "../../scriptbug/main.cpp: In instantiation of void bar(i) [with i = double]:\n" "../../scriptbug/main.cpp:8: instantiated from void foo(i) [with i = double]", - FilePath::fromUserInput("../../scriptbug/main.cpp")) + FilePath::fromUserInput("../../scriptbug/main.cpp"), + -1, + QVector() + << formatRange(17, 195)) << CompileTask(Task::Unknown, "instantiated from here", FilePath::fromUserInput("../../scriptbug/main.cpp"), @@ -604,6 +668,14 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() 54)) << QString(); + formatRanges.clear(); + if (HostOsInfo::isWindowsHost()) { + formatRanges << formatRange(46, 44) + << formatRange(90, 39, "olpfile://M:/Development/x64/QtPlot/qplotaxis.cpp::26::-1") + << formatRange(129, 50); + } else { + formatRanges << formatRange(46, 133); + } QTest::newRow("QTCREATORBUG-597") << QString::fromLatin1("debug/qplotaxis.o: In function `QPlotAxis':\n" "M:\\Development\\x64\\QtPlot/qplotaxis.cpp:26: undefined reference to `vtable for QPlotAxis'\n" @@ -612,12 +684,13 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Error, + << compileTask(Task::Error, "undefined reference to `vtable for QPlotAxis'\n" "debug/qplotaxis.o: In function `QPlotAxis':\n" "M:\\Development\\x64\\QtPlot/qplotaxis.cpp:26: undefined reference to `vtable for QPlotAxis'", FilePath::fromUserInput("M:\\Development\\x64\\QtPlot/qplotaxis.cpp"), - 26) + 26, + formatRanges) << CompileTask(Task::Error, "undefined reference to `vtable for QPlotAxis'", FilePath::fromUserInput("M:\\Development\\x64\\QtPlot/qplotaxis.cpp"), @@ -635,21 +708,41 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Unknown, + << compileTask(Task::Unknown, "In member function typename _Vector_base<_Tp, _Alloc>::_Tp_alloc_type::const_reference Vector<_Tp, _Alloc>::at(int) [with _Tp = Point, _Alloc = Allocator]:\n" "../stl/main.cpp: In member function typename _Vector_base<_Tp, _Alloc>::_Tp_alloc_type::const_reference Vector<_Tp, _Alloc>::at(int) [with _Tp = Point, _Alloc = Allocator]:\n" "../stl/main.cpp:38: instantiated from here", - FilePath::fromUserInput("../stl/main.cpp"), -1) + FilePath::fromUserInput("../stl/main.cpp"), + -1, + QVector() + << formatRange(163, 224)) << CompileTask(Task::Warning, "returning reference to temporary", FilePath::fromUserInput("../stl/main.cpp"), 31) - << CompileTask(Task::Warning, + << compileTask(Task::Warning, "unused parameter index\n" "../stl/main.cpp: At global scope:\n" "../stl/main.cpp:31: warning: unused parameter index", - FilePath::fromUserInput("../stl/main.cpp"), 31)) + FilePath::fromUserInput("../stl/main.cpp"), + 31, + QVector() + << formatRange(23, 85))) << QString(); + formatRanges.clear(); + if (HostOsInfo::isWindowsHost()) { + formatRanges << formatRange(33, 22) + << formatRange(55, 38, "olpfile://C:/Symbian_SDK/epoc32/include/e32cmn.h::6792::-1") + << formatRange(93, 29) + << formatRange(122, 38, "olpfile://C:/Symbian_SDK/epoc32/include/e32std.h::25::-1") + << formatRange(160, 5) + << formatRange(165, 40, "olpfile://C:/Symbian_SDK/epoc32/include/e32cmn.inl::0::-1") + << formatRange(205, 69) + << formatRange(274, 40, "olpfile://C:/Symbian_SDK/epoc32/include/e32cmn.inl::7094::-1") + << formatRange(314, 48); + } else { + formatRanges << formatRange(33, 329); + } QTest::newRow("GCCE from lines") << QString::fromLatin1("In file included from C:/Symbian_SDK/epoc32/include/e32cmn.h:6792,\n" " from C:/Symbian_SDK/epoc32/include/e32std.h:25,\n" @@ -657,14 +750,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() "C:/Symbian_SDK/epoc32/include/e32cmn.inl:7094: warning: returning reference to temporary") << OutputParserTester::STDERR << QString() << QString() - << Tasks{CompileTask(Task::Warning, + << Tasks{compileTask(Task::Warning, "returning reference to temporary\n" "In file included from C:/Symbian_SDK/epoc32/include/e32cmn.h:6792,\n" " from C:/Symbian_SDK/epoc32/include/e32std.h:25,\n" "C:/Symbian_SDK/epoc32/include/e32cmn.inl: In member function 'SSecureId::operator const TSecureId&() const':\n" "C:/Symbian_SDK/epoc32/include/e32cmn.inl:7094: warning: returning reference to temporary", FilePath::fromUserInput("C:/Symbian_SDK/epoc32/include/e32cmn.inl"), - 7094)} + 7094, + formatRanges)} << QString(); QTest::newRow("In constructor 2") << QString::fromUtf8("perfattributes.cpp: In constructor ‘PerfEventAttributes::PerfEventAttributes()’:\n" @@ -673,13 +767,16 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() " | ^") << OutputParserTester::STDERR << QString() << QString() - << Tasks{CompileTask(Task::Warning, + << Tasks{compileTask(Task::Warning, "‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class PerfEventAttributes’; use assignment or value-initialization instead [-Wclass-memaccess]\n" "perfattributes.cpp: In constructor ‘PerfEventAttributes::PerfEventAttributes()’:\n" "perfattributes.cpp:28:48: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘class PerfEventAttributes’; use assignment or value-initialization instead [-Wclass-memaccess]\n" " 28 | memset(this, 0, sizeof(PerfEventAttributes));\n" " | ^", - FilePath::fromUserInput("perfattributes.cpp"), 28)} + FilePath::fromUserInput("perfattributes.cpp"), + 28, + QVector() + << formatRange(170, 400))} << QString(); QTest::newRow("QTCREATORBUG-2206") << QString::fromLatin1("../../../src/XmlUg/targetdelete.c: At top level:") @@ -697,14 +794,20 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() "/Symbian/SDK/epoc32/include/variant/Symbian_OS.hrh:1134:26: warning: no newline at end of file") << OutputParserTester::STDERR << QString() << QString() - << Tasks{CompileTask( + << Tasks{compileTask( Task::Warning, "no newline at end of file\n" "In file included from /Symbian/SDK/EPOC32/INCLUDE/GCCE/GCCE.h:15,\n" " from :26:\n" "/Symbian/SDK/epoc32/include/variant/Symbian_OS.hrh:1134:26: warning: no newline at end of file", FilePath::fromUserInput("/Symbian/SDK/epoc32/include/variant/Symbian_OS.hrh"), - 1134)} + 1134, + QVector() + << formatRange(26, 22) + << formatRange(48, 39, "olpfile:///Symbian/SDK/EPOC32/INCLUDE/GCCE/GCCE.h::15::-1") + << formatRange(87, 46) + << formatRange(133, 50, "olpfile:///Symbian/SDK/epoc32/include/variant/Symbian_OS.hrh::1134::-1") + << formatRange(183, 44))} << QString(); QTest::newRow("Linker fail (release build)") @@ -723,12 +826,14 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Warning, + << compileTask(Task::Warning, "case value '0' not in enumerated type 'ProFileEvaluator::Private::TestFunc'\n" "../../../src/shared/proparser/profileevaluator.cpp: In member function 'ProFileEvaluator::Private::VisitReturn ProFileEvaluator::Private::evaluateConditionalFunction(const ProString&, const ProStringList&)':\n" "../../../src/shared/proparser/profileevaluator.cpp:2817:9: warning: case value '0' not in enumerated type 'ProFileEvaluator::Private::TestFunc'", FilePath::fromUserInput("../../../src/shared/proparser/profileevaluator.cpp"), - 2817)) + 2817, + QVector() + << formatRange(76, 351))) << QString(); QTest::newRow("include with line:column info") @@ -736,12 +841,15 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() "./mw.h:4:0: warning: \"STUPID_DEFINE\" redefined") << OutputParserTester::STDERR << QString() << QString() - << Tasks{CompileTask( + << Tasks{compileTask( Task::Warning, "\"STUPID_DEFINE\" redefined\n" "In file included from :0:0:\n" "./mw.h:4:0: warning: \"STUPID_DEFINE\" redefined", - FilePath::fromUserInput("./mw.h"), 4)} + FilePath::fromUserInput("./mw.h"), + 4, + QVector() + << formatRange(26, 88))} << QString(); QTest::newRow("instantiation with line:column info") @@ -751,11 +859,14 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Unknown, + << compileTask(Task::Unknown, "In function 'void UnitTest::CheckEqual(UnitTest::TestResults&, const Expected&, const Actual&, const UnitTest::TestDetails&) [with Expected = unsigned int, Actual = int]':\n" "file.h: In function 'void UnitTest::CheckEqual(UnitTest::TestResults&, const Expected&, const Actual&, const UnitTest::TestDetails&) [with Expected = unsigned int, Actual = int]':\n" "file.cpp:87:10: instantiated from here", - FilePath::fromUserInput("file.h")) + FilePath::fromUserInput("file.h"), + -1, + QVector() + << formatRange(172, 218)) << CompileTask(Task::Warning, "comparison between signed and unsigned integer expressions [-Wsign-compare]", FilePath::fromUserInput("file.h"), @@ -799,14 +910,19 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() " ^") << OutputParserTester::STDERR << QString() << QString() - << Tasks{CompileTask( + << Tasks{compileTask( Task::Error, "QtGui/QAction: No such file or directory\n" "In file included from /home/code/src/creator/src/libs/extensionsystem/pluginerrorview.cpp:31:0:\n" ".uic/ui_pluginerrorview.h:14:25: fatal error: QtGui/QAction: No such file or directory\n" " #include \n" " ^", - FilePath::fromUserInput(".uic/ui_pluginerrorview.h"), 14)} + FilePath::fromUserInput(".uic/ui_pluginerrorview.h"), + 14, + QVector() + << formatRange(41, 22) + << formatRange(63, 67, "olpfile:///home/code/src/creator/src/libs/extensionsystem/pluginerrorview.cpp::31::-1") + << formatRange(130, 146))} << QString(); QTest::newRow("qtcreatorbug-9195") @@ -817,7 +933,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() "main.cpp:7:22: error: within this context") << OutputParserTester::STDERR << QString() << QString() - << Tasks{CompileTask( + << Tasks{compileTask( Task::Error, "'QString::QString(const char*)' is private\n" "In file included from /usr/include/qt4/QtCore/QString:1:0,\n" @@ -825,7 +941,16 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() "/usr/include/qt4/QtCore/qstring.h: In function 'void foo()':\n" "/usr/include/qt4/QtCore/qstring.h:597:5: error: 'QString::QString(const char*)' is private\n" "main.cpp:7:22: error: within this context", - FilePath::fromUserInput("/usr/include/qt4/QtCore/qstring.h"), 597)} + FilePath::fromUserInput("/usr/include/qt4/QtCore/qstring.h"), + 597, + QVector() + << formatRange(43, 22) + << formatRange(65, 31, "olpfile:///usr/include/qt4/QtCore/QString::1::-1") + << formatRange(96, 40) + << formatRange(136, 33, "olpfile:///usr/include/qt4/QtCore/qstring.h::0::-1") + << formatRange(169, 28) + << formatRange(197, 33, "olpfile:///usr/include/qt4/QtCore/qstring.h::597::-1") + << formatRange(230, 99))} << QString(); QTest::newRow("ld: Multiple definition error") @@ -836,12 +961,16 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() << OutputParserTester::STDERR << QString() << QString() << (Tasks() - << CompileTask(Task::Error, + << compileTask(Task::Error, "multiple definition of `foo()'\n" "foo.o: In function `foo()':\n" "/home/user/test/foo.cpp:2: multiple definition of `foo()'", FilePath::fromUserInput("/home/user/test/foo.cpp"), - 2) + 2, + QVector() + << formatRange(31, 28) + << formatRange(59, 23, "olpfile:///home/user/test/foo.cpp::2::-1") + << formatRange(82, 34)) << CompileTask(Task::Unknown, "first defined here", FilePath::fromUserInput("/home/user/test/bar.cpp"), @@ -1089,7 +1218,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() ) << OutputParserTester::STDERR << QString() << QString() - << Tasks{CompileTask(Task::Warning, + << Tasks{compileTask(Task::Warning, "implicitly-declared ‘constexpr QVariant::Private& QVariant::Private::operator=(const QVariant::Private&)’ is deprecated [-Wdeprecated-copy]\n" "In file included from /usr/include/qt/QtCore/qlocale.h:43,\n" " from /usr/include/qt/QtCore/qtextstream.h:46,\n" @@ -1101,8 +1230,23 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() "/usr/include/qt/QtCore/qvariant.h:399:16: note: because ‘QVariant::Private’ has user-provided ‘QVariant::Private::Private(const QVariant::Private&)’\n" " 399 | inline Private(const Private &other) Q_DECL_NOTHROW\n" " | ^~~~~~~)", - FilePath::fromUserInput("/usr/include/qt/QtCore/qvariant.h"), 273), - CompileTask(Task::Error, + FilePath::fromUserInput("/usr/include/qt/QtCore/qvariant.h"), + 273, + QVector() + << formatRange(140, 22) + << formatRange(162, 32, "olpfile:///usr/include/qt/QtCore/qlocale.h::43::-1") + << formatRange(194, 27) + << formatRange(221, 36, "olpfile:///usr/include/qt/QtCore/qtextstream.h::46::-1") + << formatRange(257, 27) + << formatRange(284, 38, "olpfile:///qtc/src/shared/proparser/proitems.cpp::31::-1") + << formatRange(322, 5) + << formatRange(327, 33, "olpfile:///usr/include/qt/QtCore/qvariant.h::0::-1") + << formatRange(360, 51) + << formatRange(411, 33, "olpfile:///usr/include/qt/QtCore/qvariant.h::273::-1") + << formatRange(444, 229) + << formatRange(673, 33, "olpfile:///usr/include/qt/QtCore/qvariant.h::399::-1") + << formatRange(706, 221)), + compileTask(Task::Error, "no match for ‘operator+’ (operand types are ‘boxed_value’ and ‘boxed_value’)\n" "t.cc: In function ‘int test(const shape&, const shape&)’:\n" "t.cc:15:4: error: no match for ‘operator+’ (operand types are ‘boxed_value’ and ‘boxed_value’)\n" @@ -1115,8 +1259,10 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() " | |\n" " | boxed_value<[...]>", FilePath::fromUserInput("t.cc"), - 15), - CompileTask(Task::Error, + 15, + QVector() + << formatRange(93, 460)), + compileTask(Task::Error, "‘string’ in namespace ‘std’ does not name a type\n" "incomplete.c:1:6: error: ‘string’ in namespace ‘std’ does not name a type\n" " 1 | std::string test(void)\n" @@ -1125,8 +1271,10 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() " +++ |+#include \n" " 1 | std::string test(void)", FilePath::fromUserInput("incomplete.c"), - 1), - CompileTask(Task::Warning, + 1, + QVector() + << formatRange(49, 284)), + compileTask(Task::Warning, "passing argument 2 of ‘callee’ makes pointer from integer without a cast [-Wint-conversion]\n" "param-type-mismatch.c: In function ‘caller’:\n" "param-type-mismatch.c:5:24: warning: passing argument 2 of ‘callee’ makes pointer from integer without a cast [-Wint-conversion]\n" @@ -1137,7 +1285,10 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() "param-type-mismatch.c:1:40: note: expected ‘const char *’ but argument is of type ‘int’\n" " 1 | extern int callee(int one, const char *two, float three);\n" " | ~~~~~~~~~~~~^~~", - FilePath::fromUserInput("param-type-mismatch.c"), 5)} + FilePath::fromUserInput("param-type-mismatch.c"), + 5, + QVector() + << formatRange(92, 519))} << QString(); QTest::newRow(R"("inlined from")") @@ -1154,7 +1305,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() " | ~~~~~~~~~~~~^~~") << OutputParserTester::STDERR << QString() << QString() - << Tasks{CompileTask(Task::Warning, + << Tasks{compileTask(Task::Warning, "writing 1 byte into a region of size 0 [-Wstringop-overflow=]\n" "In file included from smallstringvector.h:30,\n" " from smallstringio.h:28,\n" @@ -1167,7 +1318,10 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() "smallstring.h:465:21: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]\n" " 465 | at(newSize) = 0;\n" " | ~~~~~~~~~~~~^~~", - FilePath::fromUserInput("smallstring.h"), 465)} + FilePath::fromUserInput("smallstring.h"), + 465, + QVector() + << formatRange(62, 805))} << QString(); QTest::newRow(R"("required from")") @@ -1189,7 +1343,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() " | ^~~~~") << OutputParserTester::STDERR << QString() << QString() - << Tasks{CompileTask(Task::Error, + << Tasks{compileTask(Task::Error, "‘QMapNode::value’ has incomplete type\n" "In file included from qmap.h:1,\n" " from qvariant.h:47,\n" @@ -1206,7 +1360,10 @@ void ProjectExplorerPlugin::testGccOutputParsers_data() "qmap.h:110:7: error: ‘QMapNode::value’ has incomplete type\n" " 110 | T value;\n" " | ^~~~~", - FilePath::fromUserInput("qmap.h"), 110)} + FilePath::fromUserInput("qmap.h"), + 110, + QVector() + << formatRange(46, 1458))} << QString(); QTest::newRow("cc1plus") diff --git a/src/plugins/projectexplorer/msvcparser.cpp b/src/plugins/projectexplorer/msvcparser.cpp index b351ea889bf..2ed0366902a 100644 --- a/src/plugins/projectexplorer/msvcparser.cpp +++ b/src/plugins/projectexplorer/msvcparser.cpp @@ -317,6 +317,25 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() QTest::addColumn("tasks"); QTest::addColumn("outputLines"); + auto compileTask = [](Task::TaskType type, + const QString &description, + const Utils::FilePath &file, + int line, + const QVector formats) + { + CompileTask task(type, description, file, line); + task.formats = formats; + return task; + }; + + auto formatRange = [](int start, int length, const QString &anchorHref = QString()) + { + QTextCharFormat format; + format.setAnchorHref(anchorHref); + + return QTextLayout::FormatRange{start, length, format}; + }; + QTest::newRow("pass-through stdout") << "Sometext" << OutputParserTester::STDOUT << "Sometext\n" << "" @@ -436,14 +455,17 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << OutputParserTester::STDOUT << "" << "" << (Tasks() - << CompileTask(Task::Error, + << compileTask(Task::Error, "C2440: 'initializing' : cannot convert from 'int' to 'std::_Tree<_Traits>::iterator'\n" " with\n" " [\n" " _Traits=std::_Tmap_traits,std::allocator>,false>\n" " ]\n" " No constructor could take the source type, or constructor overload resolution was ambiguous", - FilePath::fromUserInput("..\\untitled\\main.cpp"), 19)) + FilePath::fromUserInput("..\\untitled\\main.cpp"), + 19, + QVector() + << formatRange(85, 247))) << ""; QTest::newRow("Linker error 1") @@ -502,14 +524,17 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() << CompileTask(Task::Unknown, "see declaration of 'std::_Copy_impl'", FilePath::fromUserInput("c:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\VC\\INCLUDE\\xutility"), 2212) - << CompileTask(Task::Unknown, + << compileTask(Task::Unknown, "see reference to function template instantiation '_OutIt std::copy(_InIt,_InIt,_OutIt)' being compiled\n" " with\n" " [\n" " _OutIt=unsigned short *,\n" " _InIt=const unsigned char *\n" " ]", - FilePath::fromUserInput("symbolgroupvalue.cpp"), 2314)) + FilePath::fromUserInput("symbolgroupvalue.cpp"), + 2314, + QVector() + << formatRange(141, 109))) << ""; QTest::newRow("Ambiguous symbol") @@ -542,10 +567,13 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data() "main.cpp(6): note: see declaration of 'func'" << OutputParserTester::STDOUT << "" << "" - << Tasks{CompileTask(Task::Error, + << Tasks{compileTask(Task::Error, "C2733: 'func': second C linkage of overloaded function not allowed\n" "main.cpp(6): note: see declaration of 'func'", - FilePath::fromUserInput("main.cpp"), 7)} + FilePath::fromUserInput("main.cpp"), + 7, + QVector() + << formatRange(67, 44))} << ""; QTest::newRow("cyrillic warning") // QTCREATORBUG-20297 diff --git a/src/plugins/projectexplorer/outputparser_test.cpp b/src/plugins/projectexplorer/outputparser_test.cpp index a70a33a8d88..18e3a7ae19a 100644 --- a/src/plugins/projectexplorer/outputparser_test.cpp +++ b/src/plugins/projectexplorer/outputparser_test.cpp @@ -92,6 +92,15 @@ void OutputParserTester::testParsing(const QString &lines, msgFileComparisonFail(m_receivedTasks.at(i).file, tasks.at(i).file)); QCOMPARE(m_receivedTasks.at(i).line, tasks.at(i).line); QCOMPARE(static_cast(m_receivedTasks.at(i).type), static_cast(tasks.at(i).type)); + // Skip formats check if we haven't specified expected + if (tasks.at(i).formats.size() == 0) + continue; + QCOMPARE(m_receivedTasks.at(i).formats.size(), tasks.at(i).formats.size()); + for (int j = 0; j < tasks.at(i).formats.size(); ++j) { + QCOMPARE(m_receivedTasks.at(i).formats.at(j).start, tasks.at(i).formats.at(j).start); + QCOMPARE(m_receivedTasks.at(i).formats.at(j).length, tasks.at(i).formats.at(j).length); + QCOMPARE(m_receivedTasks.at(i).formats.at(j).format.anchorHref(), tasks.at(i).formats.at(j).format.anchorHref()); + } } } } diff --git a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp index cccc108bbb5..808882220eb 100644 --- a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp +++ b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp @@ -1515,6 +1515,14 @@ QList DesignerActionManager::designerActions() const }); } +ActionInterface *DesignerActionManager::actionByMenuId(const QByteArray &id) +{ + for (const auto &action : m_designerActions) + if (action->menuId() == id) + return action.data(); + return nullptr; +} + DesignerActionManager::DesignerActionManager(DesignerActionManagerView *designerActionManagerView) : m_designerActionManagerView(designerActionManagerView) { diff --git a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.h b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.h index bf7ab60017f..36253fc4453 100644 --- a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.h +++ b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.h @@ -110,6 +110,7 @@ public: QList> actionsForTargetView(const ActionInterface::TargetView &target); QList designerActions() const; + ActionInterface *actionByMenuId(const QByteArray &id); void createDefaultDesignerActions(); void createDefaultAddResourceHandler(); diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp index 8571f7a7d4b..1fcaadb5634 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibrarywidget.cpp @@ -138,6 +138,7 @@ ItemLibraryWidget::ItemLibraryWidget(AsynchronousImageCache &imageCache, ItemLibraryModel::registerQmlTypes(); setWindowTitle(tr("Library", "Title of library view")); + setMinimumWidth(100); // create header widget m_headerWidget->setResizeMode(QQuickWidget::SizeRootObjectToView); diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp index eb4acb358d3..220d2fb5afa 100644 --- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp +++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp @@ -298,7 +298,7 @@ void StatesEditorView::renameState(int internalNodeId, const QString &newName) setCurrentState(baseState()); const bool updateDefault = state.isDefault(); - state.setName(newName); + state.setName(newName.trimmed()); if (updateDefault) state.setAsDefault(); diff --git a/src/plugins/qtsupport/qtoptionspage.cpp b/src/plugins/qtsupport/qtoptionspage.cpp index b5a227f3010..5e1578a09e5 100644 --- a/src/plugins/qtsupport/qtoptionspage.cpp +++ b/src/plugins/qtsupport/qtoptionspage.cpp @@ -848,7 +848,7 @@ static bool canLinkWithQt(QString *toolTip) const QString link = installSettingsValue ? *installSettingsValue : QString(); if (!link.isEmpty()) tip << QtOptionsPageWidget::tr("%1 is currently linked to \"%2\".") - .arg(QString(Core::Constants::IDE_DISPLAY_NAME), link); + .arg(QString(Core::Constants::IDE_DISPLAY_NAME), QDir::toNativeSeparators(link)); if (toolTip) *toolTip = tip.join("\n\n"); return canLink; diff --git a/src/shared/qbs b/src/shared/qbs index b9907900069..481c2a0a47d 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit b99079000697268bdf29c8ae09aa9fc02235edfc +Subproject commit 481c2a0a47d9c97bfa3d09869591e47e37f75c0b diff --git a/src/tools/clangbackend/source/tokeninfo.cpp b/src/tools/clangbackend/source/tokeninfo.cpp index b7e8f5d572c..1ca8f4cac03 100644 --- a/src/tools/clangbackend/source/tokeninfo.cpp +++ b/src/tools/clangbackend/source/tokeninfo.cpp @@ -597,7 +597,9 @@ void TokenInfo::punctuationOrOperatorKind() break; } - if (m_types.mixinHighlightingTypes.empty() && kind != CXCursor_InclusionDirective) { + if (m_types.mixinHighlightingTypes.empty() + && kind != CXCursor_InclusionDirective + && kind != CXCursor_PreprocessingDirective) { const ClangString spelling = m_token->spelling(); if (spelling == "<") m_types.mixinHighlightingTypes.push_back(HighlightingType::AngleBracketOpen); diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp index 64fd5636661..8cf610bd281 100644 --- a/tests/auto/debugger/tst_dumpers.cpp +++ b/tests/auto/debugger/tst_dumpers.cpp @@ -2303,35 +2303,6 @@ void tst_Dumpers::dumper_data() // Value5("Tue Jan 1 13:15:32 1980 GMT"), "@QDateTime") % Optional(); -#ifdef Q_OS_WIN - QString tempDir = "C:/Program Files"; -#else - QString tempDir = "/tmp"; -#endif - auto quoted = [](const QString &str) { return QString('"' + str + '"'); }; - - QTest::newRow("QDir") - << Data("#include \n", - - "QDir dir(" + quoted(tempDir) + ");\n" - "QString s = dir.absolutePath();\n" - "QFileInfoList fil = dir.entryInfoList();\n" - "QFileInfo fi = fil.first();", - - "&dir, &s, &fi") - - + CoreProfile() - + QtVersion(0x50300) - - + Check("dir", quoted(tempDir), "@QDir") - // + Check("dir.canonicalPath", quoted(tempDir), "@QString") - + Check("dir.absolutePath", quoted(tempDir), "@QString") % Optional() - + Check("dir.entryInfoList.0", "[0]", quoted(tempDir + "/."), "@QFileInfo") % NoCdbEngine - + Check("dir.entryInfoList.1", "[1]", quoted(tempDir + "/.."), "@QFileInfo") % NoCdbEngine - + Check("dir.entryList.0", "[0]", "\".\"", "@QString") % NoCdbEngine - + Check("dir.entryList.1", "[1]", "\"..\"", "@QString") % NoCdbEngine; - - QTest::newRow("QFileInfo") #ifdef Q_OS_WIN << Data("#include \n" @@ -8176,6 +8147,37 @@ void tst_Dumpers::dumper_data() + Check("x.2", "[2]", "3", "NI"); #endif #endif + + +/* FIXME for unknown reasons the following test must be the last one to not interfere with the + dumper tests and make all following fail */ +#ifdef Q_OS_WIN + QString tempDir = "C:/Program Files"; +#else + QString tempDir = "/tmp"; +#endif + auto quoted = [](const QString &str) { return QString('"' + str + '"'); }; + + QTest::newRow("QDir") + << Data("#include \n", + + "QDir dir(" + quoted(tempDir) + ");\n" + "QString s = dir.absolutePath();\n" + "QFileInfoList fil = dir.entryInfoList();\n" + "QFileInfo fi = fil.first();", + + "&dir, &s, &fi") + + + CoreProfile() + + QtVersion(0x50300) + + + Check("dir", quoted(tempDir), "@QDir") + // + Check("dir.canonicalPath", quoted(tempDir), "@QString") + + Check("dir.absolutePath", quoted(tempDir), "@QString") % Optional() + + Check("dir.entryInfoList.0", "[0]", quoted(tempDir + "/."), "@QFileInfo") % NoCdbEngine + + Check("dir.entryInfoList.1", "[1]", quoted(tempDir + "/.."), "@QFileInfo") % NoCdbEngine + + Check("dir.entryList.0", "[0]", "\".\"", "@QString") % NoCdbEngine + + Check("dir.entryList.1", "[1]", "\"..\"", "@QString") % NoCdbEngine; } int main(int argc, char *argv[])