diff --git a/cmake/FindGoogleBenchmark.cmake b/cmake/FindGoogleBenchmark.cmake index 5713803535a..c0c5125da72 100644 --- a/cmake/FindGoogleBenchmark.cmake +++ b/cmake/FindGoogleBenchmark.cmake @@ -57,6 +57,7 @@ if(GoogleBenchmark_FOUND AND NOT TARGET GoogleBenchmark) "${GOOGLE_BENCHMARK_SRC_DIR}/counter.cc" "${GOOGLE_BENCHMARK_SRC_DIR}/csv_reporter.cc" "${GOOGLE_BENCHMARK_SRC_DIR}/json_reporter.cc" + "${GOOGLE_BENCHMARK_SRC_DIR}/perf_counters.cc" "${GOOGLE_BENCHMARK_SRC_DIR}/reporter.cc" "${GOOGLE_BENCHMARK_SRC_DIR}/sleep.cc" "${GOOGLE_BENCHMARK_SRC_DIR}/statistics.cc" diff --git a/coin/product_dependencies.yaml b/coin/product_dependencies.yaml index f853a491917..08569b97254 100644 --- a/coin/product_dependencies.yaml +++ b/coin/product_dependencies.yaml @@ -1,4 +1,4 @@ dependencies: ../../qt/qt5.git: - ref: "6.1" + ref: "6.2" diff --git a/doc/qtcreator/images/icons/align-bottom.png b/doc/qtcreator/images/icons/align-bottom.png new file mode 100644 index 00000000000..07277d74a9e Binary files /dev/null and b/doc/qtcreator/images/icons/align-bottom.png differ diff --git a/doc/qtcreator/images/icons/align-center-horizontal.png b/doc/qtcreator/images/icons/align-center-horizontal.png new file mode 100644 index 00000000000..d0af695e8df Binary files /dev/null and b/doc/qtcreator/images/icons/align-center-horizontal.png differ diff --git a/doc/qtcreator/images/icons/align-center-vertical.png b/doc/qtcreator/images/icons/align-center-vertical.png new file mode 100644 index 00000000000..8d423733511 Binary files /dev/null and b/doc/qtcreator/images/icons/align-center-vertical.png differ diff --git a/doc/qtcreator/images/icons/align-left.png b/doc/qtcreator/images/icons/align-left.png new file mode 100644 index 00000000000..3552235feb9 Binary files /dev/null and b/doc/qtcreator/images/icons/align-left.png differ diff --git a/doc/qtcreator/images/icons/align-right.png b/doc/qtcreator/images/icons/align-right.png new file mode 100644 index 00000000000..68d8ac7d3b1 Binary files /dev/null and b/doc/qtcreator/images/icons/align-right.png differ diff --git a/doc/qtcreator/images/icons/align-top.png b/doc/qtcreator/images/icons/align-top.png new file mode 100644 index 00000000000..00568f56809 Binary files /dev/null and b/doc/qtcreator/images/icons/align-top.png differ diff --git a/doc/qtcreator/images/icons/anchor-bottom.png b/doc/qtcreator/images/icons/anchor-bottom.png index 9ef1e5b3646..e6ab30a9ecb 100644 Binary files a/doc/qtcreator/images/icons/anchor-bottom.png and b/doc/qtcreator/images/icons/anchor-bottom.png differ diff --git a/doc/qtcreator/images/icons/anchor-fill.png b/doc/qtcreator/images/icons/anchor-fill.png index da8b6bf92b3..64a27939323 100644 Binary files a/doc/qtcreator/images/icons/anchor-fill.png and b/doc/qtcreator/images/icons/anchor-fill.png differ diff --git a/doc/qtcreator/images/icons/anchor-left.png b/doc/qtcreator/images/icons/anchor-left.png index 78c3c90b250..f3ebeab5000 100644 Binary files a/doc/qtcreator/images/icons/anchor-left.png and b/doc/qtcreator/images/icons/anchor-left.png differ diff --git a/doc/qtcreator/images/icons/anchor-right.png b/doc/qtcreator/images/icons/anchor-right.png index 042dc830b77..43609aa397c 100644 Binary files a/doc/qtcreator/images/icons/anchor-right.png and b/doc/qtcreator/images/icons/anchor-right.png differ diff --git a/doc/qtcreator/images/icons/anchor-top.png b/doc/qtcreator/images/icons/anchor-top.png index 4136ca624fa..896930eb640 100644 Binary files a/doc/qtcreator/images/icons/anchor-top.png and b/doc/qtcreator/images/icons/anchor-top.png differ diff --git a/doc/qtcreator/images/icons/center-horizontal.png b/doc/qtcreator/images/icons/center-horizontal.png new file mode 100644 index 00000000000..cdea461bd3d Binary files /dev/null and b/doc/qtcreator/images/icons/center-horizontal.png differ diff --git a/doc/qtcreator/images/icons/center-vertical.png b/doc/qtcreator/images/icons/center-vertical.png new file mode 100644 index 00000000000..b3be3037238 Binary files /dev/null and b/doc/qtcreator/images/icons/center-vertical.png differ diff --git a/doc/qtcreator/images/icons/distribute-bottom.png b/doc/qtcreator/images/icons/distribute-bottom.png new file mode 100644 index 00000000000..dccb5b535ae Binary files /dev/null and b/doc/qtcreator/images/icons/distribute-bottom.png differ diff --git a/doc/qtcreator/images/icons/distribute-center-horizontal.png b/doc/qtcreator/images/icons/distribute-center-horizontal.png new file mode 100644 index 00000000000..5ad6d0dff91 Binary files /dev/null and b/doc/qtcreator/images/icons/distribute-center-horizontal.png differ diff --git a/doc/qtcreator/images/icons/distribute-center-vertical.png b/doc/qtcreator/images/icons/distribute-center-vertical.png new file mode 100644 index 00000000000..1b6cc09588b Binary files /dev/null and b/doc/qtcreator/images/icons/distribute-center-vertical.png differ diff --git a/doc/qtcreator/images/icons/distribute-left.png b/doc/qtcreator/images/icons/distribute-left.png new file mode 100644 index 00000000000..92ce603cace Binary files /dev/null and b/doc/qtcreator/images/icons/distribute-left.png differ diff --git a/doc/qtcreator/images/icons/distribute-origin-bottom-right.png b/doc/qtcreator/images/icons/distribute-origin-bottom-right.png new file mode 100644 index 00000000000..ed679229597 Binary files /dev/null and b/doc/qtcreator/images/icons/distribute-origin-bottom-right.png differ diff --git a/doc/qtcreator/images/icons/distribute-origin-center.png b/doc/qtcreator/images/icons/distribute-origin-center.png new file mode 100644 index 00000000000..391d3d640f8 Binary files /dev/null and b/doc/qtcreator/images/icons/distribute-origin-center.png differ diff --git a/doc/qtcreator/images/icons/distribute-origin-none.png b/doc/qtcreator/images/icons/distribute-origin-none.png index 349f40ca26a..c4966559612 100644 Binary files a/doc/qtcreator/images/icons/distribute-origin-none.png and b/doc/qtcreator/images/icons/distribute-origin-none.png differ diff --git a/doc/qtcreator/images/icons/distribute-origin-top-left.png b/doc/qtcreator/images/icons/distribute-origin-top-left.png new file mode 100644 index 00000000000..3f20b449b59 Binary files /dev/null and b/doc/qtcreator/images/icons/distribute-origin-top-left.png differ diff --git a/doc/qtcreator/images/icons/distribute-right.png b/doc/qtcreator/images/icons/distribute-right.png new file mode 100644 index 00000000000..54527947409 Binary files /dev/null and b/doc/qtcreator/images/icons/distribute-right.png differ diff --git a/doc/qtcreator/images/icons/distribute-spacing-horizontal.png b/doc/qtcreator/images/icons/distribute-spacing-horizontal.png new file mode 100644 index 00000000000..a416a9f8d21 Binary files /dev/null and b/doc/qtcreator/images/icons/distribute-spacing-horizontal.png differ diff --git a/doc/qtcreator/images/icons/distribute-spacing-vertical.png b/doc/qtcreator/images/icons/distribute-spacing-vertical.png new file mode 100644 index 00000000000..bd1fb1a21e3 Binary files /dev/null and b/doc/qtcreator/images/icons/distribute-spacing-vertical.png differ diff --git a/doc/qtcreator/images/icons/distribute-top.png b/doc/qtcreator/images/icons/distribute-top.png new file mode 100644 index 00000000000..7f2e5749073 Binary files /dev/null and b/doc/qtcreator/images/icons/distribute-top.png differ diff --git a/doc/qtcreator/images/qmldesigner-alignment.png b/doc/qtcreator/images/qmldesigner-alignment.png index e6c6468a98f..70ad846850d 100644 Binary files a/doc/qtcreator/images/qmldesigner-alignment.png and b/doc/qtcreator/images/qmldesigner-alignment.png differ diff --git a/doc/qtcreator/images/qmldesigner-anchor-buttons.png b/doc/qtcreator/images/qmldesigner-anchor-buttons.png index 4e7e8a2fed3..28d23271d4f 100644 Binary files a/doc/qtcreator/images/qmldesigner-anchor-buttons.png and b/doc/qtcreator/images/qmldesigner-anchor-buttons.png differ diff --git a/doc/qtcreator/images/qmldesigner-anchors.png b/doc/qtcreator/images/qmldesigner-anchors.png index 6d33d222523..3b4d7d632de 100644 Binary files a/doc/qtcreator/images/qmldesigner-anchors.png and b/doc/qtcreator/images/qmldesigner-anchors.png differ diff --git a/doc/qtcreator/images/qmldesigner-binding-editor.png b/doc/qtcreator/images/qmldesigner-binding-editor.png index 0ffb326628d..35bcb93b135 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-distribute-objects.png b/doc/qtcreator/images/qmldesigner-distribute-objects.png deleted file mode 100644 index b7e036ba4bc..00000000000 Binary files a/doc/qtcreator/images/qmldesigner-distribute-objects.png and /dev/null differ diff --git a/doc/qtcreator/images/qmldesigner-distribute-spacing-evenly.png b/doc/qtcreator/images/qmldesigner-distribute-spacing-evenly.png deleted file mode 100644 index 937d77f679b..00000000000 Binary files a/doc/qtcreator/images/qmldesigner-distribute-spacing-evenly.png and /dev/null differ diff --git a/doc/qtcreator/images/qmldesigner-distribute-spacing-pixels.png b/doc/qtcreator/images/qmldesigner-distribute-spacing-pixels.png deleted file mode 100644 index d6f690affe2..00000000000 Binary files a/doc/qtcreator/images/qmldesigner-distribute-spacing-pixels.png and /dev/null differ diff --git a/doc/qtcreator/images/qmldesigner-set-expression.png b/doc/qtcreator/images/qmldesigner-set-expression.png index bdf0f24af9f..a6a507a6f17 100644 Binary files a/doc/qtcreator/images/qmldesigner-set-expression.png and b/doc/qtcreator/images/qmldesigner-set-expression.png differ diff --git a/doc/qtcreator/images/qtquick-designer-color-details.png b/doc/qtcreator/images/qtquick-designer-color-details.png new file mode 100644 index 00000000000..e011b6048c2 Binary files /dev/null and b/doc/qtcreator/images/qtquick-designer-color-details.png differ diff --git a/doc/qtcreator/images/qtquick-designer-color-palette.png b/doc/qtcreator/images/qtquick-designer-color-palette.png new file mode 100644 index 00000000000..7bffad87e8b Binary files /dev/null and b/doc/qtcreator/images/qtquick-designer-color-palette.png differ diff --git a/doc/qtcreator/images/qtquick-designer-color-picker.png b/doc/qtcreator/images/qtquick-designer-color-picker.png index d35f62e9524..3766b0f3015 100644 Binary files a/doc/qtcreator/images/qtquick-designer-color-picker.png and b/doc/qtcreator/images/qtquick-designer-color-picker.png differ diff --git a/doc/qtcreator/images/qtquick-designer-gradient-picker.png b/doc/qtcreator/images/qtquick-designer-gradient-picker.png index 56cadc4ecda..6d482284684 100644 Binary files a/doc/qtcreator/images/qtquick-designer-gradient-picker.png and b/doc/qtcreator/images/qtquick-designer-gradient-picker.png differ diff --git a/doc/qtcreator/images/qtquick-designer-gradient-properties-conical.png b/doc/qtcreator/images/qtquick-designer-gradient-properties-conical.png index 72dd3b3d26c..5ba2290f60c 100644 Binary files a/doc/qtcreator/images/qtquick-designer-gradient-properties-conical.png and b/doc/qtcreator/images/qtquick-designer-gradient-properties-conical.png differ diff --git a/doc/qtcreator/images/qtquick-designer-gradient-properties-linear.png b/doc/qtcreator/images/qtquick-designer-gradient-properties-linear.png index 3a94f97b69f..f95a3d01d39 100644 Binary files a/doc/qtcreator/images/qtquick-designer-gradient-properties-linear.png and b/doc/qtcreator/images/qtquick-designer-gradient-properties-linear.png differ diff --git a/doc/qtcreator/images/qtquick-designer-gradient-properties-radial.png b/doc/qtcreator/images/qtquick-designer-gradient-properties-radial.png index 10daa7fc43f..700f4048427 100644 Binary files a/doc/qtcreator/images/qtquick-designer-gradient-properties-radial.png and b/doc/qtcreator/images/qtquick-designer-gradient-properties-radial.png differ diff --git a/doc/qtcreator/images/qtquick-designer-gradient-stops.gif b/doc/qtcreator/images/qtquick-designer-gradient-stops.gif index 2153f3b019e..2645316f571 100644 Binary files a/doc/qtcreator/images/qtquick-designer-gradient-stops.gif and b/doc/qtcreator/images/qtquick-designer-gradient-stops.gif differ diff --git a/doc/qtcreator/images/qtquick-designer-gradient-types.png b/doc/qtcreator/images/qtquick-designer-gradient-types.png index 53ab8c99078..613cd24e813 100644 Binary files a/doc/qtcreator/images/qtquick-designer-gradient-types.png and b/doc/qtcreator/images/qtquick-designer-gradient-types.png differ diff --git a/doc/qtcreator/images/qtquick-layout-grid-properties.png b/doc/qtcreator/images/qtquick-layout-grid-properties.png index e6f85801d2f..2a6d744f73f 100644 Binary files a/doc/qtcreator/images/qtquick-layout-grid-properties.png and b/doc/qtcreator/images/qtquick-layout-grid-properties.png differ diff --git a/doc/qtcreator/images/qtquick-positioner-column-properties.png b/doc/qtcreator/images/qtquick-positioner-column-properties.png index 2e9872a5dd7..b025b5fe58f 100644 Binary files a/doc/qtcreator/images/qtquick-positioner-column-properties.png and b/doc/qtcreator/images/qtquick-positioner-column-properties.png differ diff --git a/doc/qtcreator/images/qtquick-positioner-flow-properties.png b/doc/qtcreator/images/qtquick-positioner-flow-properties.png index f1cc10552b7..c027a81817e 100644 Binary files a/doc/qtcreator/images/qtquick-positioner-flow-properties.png and b/doc/qtcreator/images/qtquick-positioner-flow-properties.png differ diff --git a/doc/qtcreator/images/qtquick-positioner-grid-properties.png b/doc/qtcreator/images/qtquick-positioner-grid-properties.png index 4427a11ccca..4588e39a239 100644 Binary files a/doc/qtcreator/images/qtquick-positioner-grid-properties.png and b/doc/qtcreator/images/qtquick-positioner-grid-properties.png differ diff --git a/doc/qtcreator/images/qtquick-properties-mouse-area-accepted-buttons.png b/doc/qtcreator/images/qtquick-properties-mouse-area-accepted-buttons.png new file mode 100644 index 00000000000..6e0400893ed Binary files /dev/null and b/doc/qtcreator/images/qtquick-properties-mouse-area-accepted-buttons.png differ diff --git a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.qdoc b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.qdoc index 67d38202a9a..4235705623b 100644 --- a/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.qdoc +++ b/doc/qtcreator/src/projects/creator-only/creator-projects-settings-run.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. @@ -72,6 +72,17 @@ \QC automatically adds run configurations for all targets declared with \c {executable()} function in Meson build descriptions. + \section1 Selecting Default Run Target + + \QC has multiple executables, but when you run a project you typically want + to run \c qtcreator and not the first executable in the list. To filter the + run target list, set \c qtc_runnable as the value of the \c FOLDER property + in the \c {CMakeLists.txt} file for the project. For example: + + \badcode + set_target_properties(main_executable PROPERTIES FOLDER "qtc_runnable") + \endcode + \section1 Creating Run Configurations for Subprojects To prevent \QC from automatically creating run configurations for SUBDIRS diff --git a/doc/qtcreator/src/qtquick/library/qtquick-user-interaction-methods.qdoc b/doc/qtcreator/src/qtquick/library/qtquick-user-interaction-methods.qdoc index 9628aa14989..408a5b6a84c 100644 --- a/doc/qtcreator/src/qtquick/library/qtquick-user-interaction-methods.qdoc +++ b/doc/qtcreator/src/qtquick/library/qtquick-user-interaction-methods.qdoc @@ -112,7 +112,13 @@ In the \uicontrol {Accepted buttons} field, select the mouse button that the mouse area reacts to. Select \uicontrol AllButtons to have the mouse - are react to all mouse buttons. + area react to all mouse buttons. You can add support for several buttons + in \l {Text Editor} or \uicontrol {Binding Editor} by combining the + values with the OR operator (|). For more information about the available + values, see the developer documentation for \l {MouseArea::acceptedButtons} + {acceptedButtons}. + + \image qtquick-properties-mouse-area-accepted-buttons.png "Adding accepted buttons in Binding Editor" In the \uicontrol {Cursor shape} field, select the cursor shape for this mouse area. On platforms that do not display a mouse cursor, this value diff --git a/doc/qtcreator/src/qtquick/qtquick-positioning.qdoc b/doc/qtcreator/src/qtquick/qtquick-positioning.qdoc index ad593ec587f..3dc0d3cbe6a 100644 --- a/doc/qtcreator/src/qtquick/qtquick-positioning.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-positioning.qdoc @@ -81,7 +81,8 @@ string and press \key Ctrl+Space to display a list of properties, IDs, and code snippets. When you enter a period (.) after a property name, a list of available values is displayed. Press \key Enter to accept the first - suggestion in the list and to complete the code. + suggestion in the list and to complete the code. For more information, see + \l{Completing Code}. When a binding is set, the \uicontrol Actions menu icon changes to \inlineimage icons/action-icon-binding @@ -135,21 +136,21 @@ \c {anchor.left: sibling.right}. This allows you to keep sibling components together. - In the following image, \uicontrol{Rectangle 2} is anchored to - \uicontrol {Rectangle 1} on its left and to the bottom of its parent. + In the following image, the left edge of \e rectangle1 is anchored to the + right edge of the sibling on its left side, \e rectangle, while its top + edge is anchored to the top of its parent. \image qmldesigner-anchors.png "Anchoring sibling components" - The anchors for \uicontrol{Rectangle 2} are specified as follows in code: + The anchors are specified as follows in code: \qml Rectangle { - id: rectangle2 - anchors.left: rectangle1.right - anchors.leftMargin: 78 - anchors.bottom: parent.bottom - anchors.bottomMargin: 200 - // + id: rectangle1 + anchors.left: rectangle.right + anchors.top: parent.top + anchors.leftMargin: 5 + anchors.topMargin: 30 } \endqml @@ -167,11 +168,11 @@ \image qmldesigner-alignment.png "Aligning sibling components" - Select the buttons in the \uicontrol Align group to align the top/bottom - or left/right edges of the components in the group to the one farthest away + Select the buttons in the \uicontrol Alignment field to align the top/bottom + or left/right edges of a group of components to the one farthest away from the center of the group. For example, when left-aligning, the components are aligned to the leftmost component. You can also align the - horizontal/vertical centers of components, or both, as in the image above. + horizontal/vertical centers of components, or both. In the \uicontrol {Align to} field, select whether to align the components in respect to the selection, the root component, or a \e {key component} @@ -185,33 +186,105 @@ values possible or tweak your design so that the components and spacing can be distributed perfectly. - When distributing components, you can select whether the distance between - them is calculated from their top/bottom or left/right edges or their - horizontal/vertical center. + When distributing components, select the buttons in the + \uicontrol {Distribute objects} field to determine whether the + distance between components is calculated from their top/bottom + or left/right edges or their horizontal/vertical center. - \image qmldesigner-distribute-objects.png "Distribute components buttons" - - You can distribute spacing either evenly within a target area or at + When distributing spacing, select the buttons in the + \uicontrol {Distribute spacing} field to determine whether + it is distributed evenly within a target area or at specified distances, calculated from a starting point. You can select the orientation in which the components are distributed evenly within the target area: horizontally along the x axis or vertically along the y axis. - \image qmldesigner-distribute-spacing-evenly.png "Distribute spacing evenly" - Alternatively, you can distribute spacing in pixels by selecting one of the - starting point buttons: left/right or top/bottom edge of the target area, - or its horizontal/vertical center. Note that some components might end up - outside the target area. + starting point buttons: top-left or bottom-right edge of the target area, + or its center. Note that some components might end up outside the target + area. - \image qmldesigner-distribute-spacing-pixels.png "Distribute spacing in pixels" - - You can set the space between components in pixels. You can - disable the distribution of spacing in pixels by clicking - the \inlineimage icons/distribute-origin-none.png + In the \uicontrol {Pixel spacing} field, you can set the space between + components in pixels. You can disable the distribution of spacing in + pixels by clicking the \inlineimage icons/distribute-origin-none.png button. + \section3 Summary of Aligment Buttons + + The following table summarizes the buttons available in the + \uicontrol Alignment section. + + \table + \header + \li Icon + \li Purpose + \row + \li \inlineimage icons/align-left.png + \li Aligns the left edges of the selected components to the one + farthest away from the center of the group. + \row + \li \inlineimage icons/align-center-horizontal.png + \li Aligns the horizontal centers of the selected components. + \row + \li \inlineimage icons/align-right.png + \li Aligns the right edges of the selected components. + \row + \li \inlineimage icons/align-top.png + \li Aligns the top edges of the selected components. + \row + \li \inlineimage icons/align-center-vertical.png + \li Aligns the verical centers of the selected components. + \row + \li \inlineimage icons/align-bottom.png + \li Aligns the bottom edges of the selected components. + \row + \li \inlineimage icons/distribute-left.png + \li Distributes the selected components and calculates the distance + between them from their left edges. + \row + \li \inlineimage icons/distribute-center-horizontal.png + \li Distributes the selected components and calculates the distance + between them from their horizontal centers. + \row + \li \inlineimage icons/distribute-right.png + \li Distributes the selected components and calculates the distance + between them from their right edges. + \row + \li \inlineimage icons/distribute-top.png + \li Distributes the selected components and calculates the distance + between them from their top edges. + \row + \li \inlineimage icons/distribute-center-vertical.png + \li Distributes the selected components and calculates the distance + between them from their vertical centers. + \row + \li \inlineimage icons/distribute-bottom.png + \li Distributes the selected components and calculates the distance + between them from their bottom edges. + \row + \li \inlineimage icons/distribute-spacing-horizontal.png + \li Distributes spacing between the selected components horizontally. + \row + \li \inlineimage icons/distribute-spacing-vertical.png + \li Distributes spacing between the selected components vertically. + \row + \li \inlineimage icons/distribute-origin-none.png + \li Disables the distribution of spacing in pixels. + \row + \li \inlineimage icons/distribute-origin-top-left.png + \li Sets the top-left corner of the target area as the starting point + for distributing spacing in pixels. + \row + \li \inlineimage icons/distribute-origin-center.png + \li Sets the center of the target area as the starting point + for distributing spacing in pixels. + \row + \li \inlineimage icons/distribute-origin-bottom-right.png + \li Sets the bottom-right corner of the target area as the starting + point for distributing spacing in pixels. + \endtable + \section2 Using Positioners Positioner components are containers that manage the positions of their @@ -239,7 +312,7 @@ In addition, you can specify the vertical and horizontal padding between content and the left, right, top, and bottom edges of components as values - of the fields in the \uicontrol Padding group. + of the fields in the \l Padding section. \section3 Row and Flow Positioners @@ -256,7 +329,8 @@ either left-to-right or top-to-bottom in the \uicontrol Flow field. Components are positioned next to to each other according to the value you set in the \uicontrol {Layout direction} field until the width or height of - the Flow component is exceeded, then wrapped to the next row or column. + the \uicontrol Flow component is exceeded, then wrapped to the next row or + column. You can set the layout direction to either \uicontrol LeftToRight or \uicontrol RightToLeft in the \uicontrol {Layout direction} field. If @@ -284,7 +358,7 @@ To mirror the layout, set the layout direction to \uicontrol RightToLeft. To also mirror the horizontal alignment of components, select - \uicontrol AlignRight in the \uicontrol {Horizontal item alignment} field. + \uicontrol AlignRight in the \uicontrol {Alignment H} field. \section3 Summary of Positioners @@ -328,8 +402,8 @@ Unlike positioners, layouts manage both the positions and sizes of their child components, and are therefore well suited for dynamic and resizable UIs. However, this means that you should not specify fixed positions and - sizes for the child components in the \l{2D Geometry}{Geometry} group in - \l Properties, unless their implicit sizes are not satisfactory. + sizes for the child components in the \l{2D Geometry}{Geometry - 2D} section + in \l Properties, unless their implicit sizes are not satisfactory. You can use anchors or the width and height properties of the layout itself to specify its size in respect to its non-layout parent component. However, @@ -367,14 +441,16 @@ The child components of grid layout components are arranged according to the \uicontrol Flow property. When the direction of a flow is set to \uicontrol LeftToRight, child components are positioned next to to each - other until the the number of \uicontrol Columns is reached. Then, + other until the the number of columns specified in the + \uicontrol {Columns & Rows} field is reached. Then, the auto-positioning wraps back to the beginning of the next row. \image qtquick-layout-grid-properties.png "Grid Layout properties" If you set the direction of the flow to \uicontrol TopToBottom, child - components are auto-positioned vertically using the value of the - \uicontrol Rows field to determine the maximum number of rows. + components are auto-positioned vertically using the number of rows set + in the \uicontrol {Columns & Rows} field to determine the maximum number + of rows. You can set the layout direction to either \uicontrol LeftToRight or \uicontrol RightToLeft in the \uicontrol {Layout direction} field. @@ -382,7 +458,7 @@ will be mirrored. You can specify the spacing between rows and columns in the - \uicontrol {Row spacing} and \uicontrol {Column spacing} fields. + \uicontrol Spacing field. \section3 Stack Layout diff --git a/doc/qtcreator/src/qtquick/qtquick-properties.qdoc b/doc/qtcreator/src/qtquick/qtquick-properties.qdoc index 71cbed41f00..9b7989fb53c 100644 --- a/doc/qtcreator/src/qtquick/qtquick-properties.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-properties.qdoc @@ -84,7 +84,7 @@ Set the properties in the \uicontrol {Geometry - 2D} section to determine the position and size of a component. - \image qtquick-properties-2d-geometry.png "2D Geometry properties" + \image qtquick-properties-2D-geometry.png "2D Geometry properties" In the \uicontrol Position group, you can set the position of a component on the x and y axis. The position of a component in the UI can be either @@ -180,21 +180,42 @@ \section1 Picking Colors - To specify the color of the selected component in the color picker view (1), - select the color picker icon (2) in the \uicontrol Properties view. + You can define color properties for some of the components in the + \uicontrol Properties view by using the color picker. Open the color picker + by clicking, for example, the color field of the \uicontrol {Fill color} or + \uicontrol {Border color} property. \image qtquick-designer-color-picker.png "Color Picker view" - You can use either a solid color (3) or a gradient (4). You can select the - gradient in the \uicontrol {Gradient Picker} (5). + To select a new color, click the color of your choice in the color selector + (1), or click the \uicontrol {Eye Dropper} icon (2) to be able to select any + color visible in your screen to use further in your project. The \uicontrol Original field displays the original color of the component, - whereas the \uicontrol New field displays the current color. The - \uicontrol Recent field displays the colors that you have last selected. + while the \uicontrol New field displays the current color. - \section1 Picking Gradients + Make the color fully transparent by clicking the \uicontrol Transparent icon + (3). - A gradient is defined by two or more colors, which will be blended + To use preset \l {Selecting Web Gradients}{web gradients}, click the + \uicontrol {Gradient Picker} icon (4). + + Use the dropdown menu (5) to determine the color fill type you wish to use. + You can choose a solid or a gradient color. Available gradient types vary + between components. The items listed in light grey are not available for the + selected component. + + The current color bar (6) shows gradient and gradient stops when a gradient + is selected. + + Use the hue slider (7) or the alpha slider (8) to further define a new + color. + + Click the \uicontrol X icon to close the color picker. + + \section2 Picking Gradients + + A gradient is defined by two or more colors which are blended seamlessly. The colors are specified as a set of gradient stops, each of which defines a position on the gradient bar from 0.0 to 1.0 and a color. Drag the gradient stops along the gradient bar to set their @@ -205,6 +226,10 @@ it with the finger-shaped cursor. To remove gradient stops, pull them away from the gradient line. + Set the direction of the gradient by selecting \uicontrol Horizontal + or \uicontrol Vertical in the \uicontrol {Gradient Controls} section of the + color picker. + \image qtquick-designer-gradient-stops.gif Calculating gradients can be computationally expensive compared to the @@ -214,10 +239,13 @@ \if defined(qtdesignstudio) \section2 Setting Gradient Properties - Select the arrow below the gradient button to set gradient properties - for \l{Shapes}{Qt Quick Studio Components}. + \image qtquick-designer-gradient-types.png "Available gradient types" - \image qtquick-designer-gradient-types.png "Gradients supported by Qt Quick Studio Components" + You can select \uicontrol Linear (1), \uicontrol Radial (2), or + \uicontrol Conical (3) as the color fill type. After selecting one of the + gradient types, you can define the gradient properties for + \l{Shapes}{Qt Quick Studio Components} in the \uicontrol {Gradient Controls} + section of the color picker. \section3 Linear Gradients @@ -227,7 +255,7 @@ vertical interpolation in the \uicontrol X1, \uicontrol X2, \uicontrol Y1, and \uicontrol Y2 fields. - \image qtquick-designer-gradient-properties-linear.png "Linear gradient properties" + \image qtquick-designer-gradient-properties-linear.png "Linear gradient controls" \section3 Radial Gradients @@ -236,16 +264,17 @@ be transparent. Outside the end points, the gradient is either padded, reflected, or repeated depending on the spread type. - \image qtquick-designer-gradient-properties-radial.png "Radial gradient properties" - You can set the center and focal radius in the \uicontrol {Center radius} and \uicontrol {Focal radius} fields. For simple radial gradients, set - the focal radius to 0. + \uicontrol {Focal radius} to 0. You can set the center and focal points in the \uicontrol CenterX, \uicontrol CenterY, \uicontrol FocalX, and \uicontrol FocalY fields. - To specify a simple radial gradient, set the focal X and focal Y to - the value of center X and center Y, respectively. + To specify a simple radial gradient, set the \uicontrol FocalX and + \uicontrol FocalY to the value of \uicontrol CenterX and \uicontrol CenterY, + respectively. + + \image qtquick-designer-gradient-properties-radial.png "Radial gradient properties" \section3 Conical Gradients @@ -264,7 +293,7 @@ that support \l QGradient. To open the \uicontrol {Gradient Picker}, select the - \uicontrol {Gradient Picker Dialog} icon in the \uicontrol Properties view. + \uicontrol {Gradient Picker Dialog} icon (4). \image qtquick-designer-gradient-picker.png "Gradient Picker dialog" @@ -273,8 +302,43 @@ To save a gradient in the \uicontrol {User Presets} tab, select \uicontrol Save. - By default, a linear gradient (4) is used, but you can select another - supported gradient type in the \uicontrol Properties view. + By default, a linear gradient is used, but you can select another + supported gradient type in the dropdown menu (5) of the color picker. + + \section2 Color Details + + Further define the colors in your project by modifying the properties in the + \uicontrol {Color Details} section of the color picker. + + \image qtquick-designer-color-details.png "Color Details tab" + + Use the \uicontrol Hex property to enter the Hex value of a new color + manually. Define exact values for red, green, and blue using the + \uicontrol Hex property to create different shades for the colors used in + the project. + + The default color value mode is HSVA (hue-saturation-value-alpha). Use the + dropdown menu to change the color value mode to RGBA (red-green-blue-alpha) + or HSLA (hue-saturation-lightness-alpha). \e Hue is defined in degrees which + refer to different colors of the color wheel. \e Saturation modifies the + intensity of the color. \e Value determines the brightness of the color. In + HSLA \e Lightness signifies the amount of white or black blended with the + color. + + \section2 Palette + + \image qtquick-designer-color-palette.png "Color Palette tab" + + Use the dropdown menu in the \uicontrol Palette section of the + color picker to change the \uicontrol Palette type. \uicontrol Recent + displays the recent colors used in the project, while \uicontrol Favorites + shows the colors you have added to your collection of favorite colors. You + can add colors to \uicontrol Favorites by right-clicking the color thumbnail + for \uicontrol Original, \uicontrol New, or in \uicontrol Palette > + \uicontrol Recent colors and selecting \uicontrol {Add to Favorites}. + + Click one of the \uicontrol Palette color thumbnails to select it as + the new color. \section1 Specifying Developer Properties diff --git a/scripts/build.py b/scripts/build.py index b0a3d20a1cd..055a5aefe55 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -247,12 +247,20 @@ def build_qtcreatorcdbext(args, paths): '--component', 'qtcreatorcdbext'], paths.qtcreatorcdbext_build) +def zipPatternForApp(paths): + # workaround for QTBUG-95845 + if not common.is_mac_platform(): + return '*' + apps = [d for d in os.listdir(paths.install) if d.endswith('.app')] + return apps[0] if apps else '*' + + def package_qtcreator(args, paths): if not args.no_zip: if not args.no_qtcreator: common.check_print_call(['7z', 'a', '-mmt' + args.zip_threads, os.path.join(paths.result, 'qtcreator' + args.zip_infix + '.7z'), - '*'], + zipPatternForApp(paths)], paths.install) common.check_print_call(['7z', 'a', '-mmt' + args.zip_threads, os.path.join(paths.result, 'qtcreator' + args.zip_infix + '_dev.7z'), diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentButton.qml index 4d4a058e8ca..e2aba8a2514 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentButton.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. @@ -24,30 +24,35 @@ ****************************************************************************/ import QtQuick 2.15 -import StudioControls 1.0 as StudioControls +import QtQuick.Layouts 1.15 +import HelperWidgets 2.0 import StudioTheme 1.0 as StudioTheme Column { - id: column width: parent.width spacing: 10 padding: 10 - Label { + Text { text: qsTr("This is an instance of a component") anchors.horizontalCenter: parent.horizontalCenter width: 300 horizontalAlignment: Text.AlignHCenter + color: StudioTheme.Values.themeTextColor + font.pixelSize: StudioTheme.Values.myFontSize } - StudioControls.AbstractButton { - id: testtest + RowLayout { + Layout.fillWidth: true anchors.horizontalCenter: parent.horizontalCenter - width: 180 + spacing: 0 - buttonIcon: qsTr("Edit Base Component") - iconFont: StudioTheme.Constants.font + AbstractButton { + implicitWidth: 180 + buttonIcon: qsTr("Edit Base Component") + iconFont: StudioTheme.Constants.font - onClicked: goIntoComponent() + onClicked: goIntoComponent() + } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml index 984ba1de4d5..66f973e1f49 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/InternalConstants.qml @@ -158,13 +158,14 @@ QtObject { readonly property string unpin: "\u0099" readonly property string upDownIcon: "\u009A" readonly property string upDownSquare2: "\u009B" - readonly property string visibilityOff: "\u009C" - readonly property string visibilityOn: "\u009D" - readonly property string wildcard: "\u009E" - readonly property string zoomAll: "\u009F" - readonly property string zoomIn: "\u00A0" - readonly property string zoomOut: "\u00A1" - readonly property string zoomSelection: "\u00A2" + readonly property string visibilityOffBroken: "\u009C" // visibilityOff + readonly property string visibilityOff: "\u009D" // visibilityOff2 + readonly property string visibilityOn: "\u009E" + readonly property string wildcard: "\u009F" + readonly property string zoomAll: "\u00A0" + readonly property string zoomIn: "\u00A1" + readonly property string zoomOut: "\u00A2" + readonly property string zoomSelection: "\u00A3" readonly property font iconFont: Qt.font({ "family": controlIcons.name, diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf index c691350148b..da54c6b6030 100644 Binary files a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf and b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf differ diff --git a/src/libs/utils/tooltip/tooltip.cpp b/src/libs/utils/tooltip/tooltip.cpp index 94d8a4c1643..681524372d1 100644 --- a/src/libs/utils/tooltip/tooltip.cpp +++ b/src/libs/utils/tooltip/tooltip.cpp @@ -155,6 +155,8 @@ void ToolTip::show( { if (content && content->count()) { auto tooltipWidget = new FakeToolTip; + // limit the size of the widget to 90% of the screen size to have some context around it + tooltipWidget->setMaximumSize(QGuiApplication::screenAt(pos)->availableSize() * 0.9); if (contextHelp.isNull()) { tooltipWidget->setLayout(content); } else { diff --git a/src/plugins/autotest/testresultdelegate.cpp b/src/plugins/autotest/testresultdelegate.cpp index 5ff0f8217f2..9d123bbad86 100644 --- a/src/plugins/autotest/testresultdelegate.cpp +++ b/src/plugins/autotest/testresultdelegate.cpp @@ -144,8 +144,11 @@ QSize TestResultDelegate::sizeHint(const QStyleOptionViewItem &option, const QMo int fontHeight = fm.height(); TestResultFilterModel *resultFilterModel = static_cast(view->model()); LayoutPositions positions(opt, resultFilterModel); + const int depth = resultFilterModel->itemForIndex(index)->level() + 1; + const int indentation = depth * view->style()->pixelMetric(QStyle::PM_TreeViewIndentation, &opt); + QSize s; - s.setWidth(opt.rect.width()); + s.setWidth(opt.rect.width() - indentation); if (selected) { const TestResult *testResult = resultFilterModel->testResult(index); @@ -153,7 +156,7 @@ QSize TestResultDelegate::sizeHint(const QStyleOptionViewItem &option, const QMo QString output = testResult->outputString(selected); limitTextOutput(output); output.replace('\n', QChar::LineSeparator); - recalculateTextLayout(index, output, opt.font, positions.textAreaWidth()); + recalculateTextLayout(index, output, opt.font, positions.textAreaWidth() - indentation); s.setHeight(m_lastCalculatedHeight + 3); } else { @@ -174,9 +177,12 @@ void TestResultDelegate::currentChanged(const QModelIndex ¤t, const QModel void TestResultDelegate::clearCache() { + const QModelIndex current = m_lastProcessedIndex; m_lastProcessedIndex = QModelIndex(); m_lastProcessedFont = QFont(); m_lastWidth = -1; + if (current.isValid()) + emit sizeHintChanged(current); } void TestResultDelegate::limitTextOutput(QString &output) const diff --git a/src/plugins/autotest/testresultspane.cpp b/src/plugins/autotest/testresultspane.cpp index 2a2c2fa0aba..6e3b9eb4c8d 100644 --- a/src/plugins/autotest/testresultspane.cpp +++ b/src/plugins/autotest/testresultspane.cpp @@ -166,6 +166,7 @@ TestResultsPane::TestResultsPane(QObject *parent) : this, &TestResultsPane::addTestResult); connect(TestRunner::instance(), &TestRunner::hadDisabledTests, m_model, &TestResultModel::raiseDisabledTests); + visualOutputWidget->installEventFilter(this); } void TestResultsPane::createToolButtons() @@ -576,6 +577,14 @@ void TestResultsPane::filterMenuTriggered(QAction *action) navigateStateChanged(); } +bool TestResultsPane::eventFilter(QObject *object, QEvent *event) +{ + QTC_ASSERT(m_outputWidget, return false); + if (event->type() == QEvent::Resize && object->parent() == m_outputWidget) + static_cast(m_treeView->itemDelegate())->clearCache(); + return false; +} + void TestResultsPane::onTestRunStarted() { m_testRunning = true; diff --git a/src/plugins/autotest/testresultspane.h b/src/plugins/autotest/testresultspane.h index b13796b5a9e..f28f1865f1b 100644 --- a/src/plugins/autotest/testresultspane.h +++ b/src/plugins/autotest/testresultspane.h @@ -105,6 +105,7 @@ private: void onRunSelectedTriggered(); void checkAllFilter(bool checked); void filterMenuTriggered(QAction *action); + bool eventFilter(QObject *object, QEvent *event) override; void initializeFilterMenu(); void updateSummaryLabel(); diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index 55c5cf713c4..34bbd27bfd3 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -1372,12 +1372,13 @@ void ClangdClient::findLocalUsages(TextEditor::TextDocument *document, const QTe void ClangdClient::gatherHelpItemForTooltip(const HoverRequest::Response &hoverResponse, const DocumentUri &uri) { - // Macros aren't locatable via the AST, so parse the formatted string. if (const Utils::optional result = hoverResponse.result()) { const HoverContent content = result->content(); const MarkupContent * const markup = Utils::get_if(&content); if (markup) { const QString markupString = markup->content(); + + // Macros aren't locatable via the AST, so parse the formatted string. static const QString magicMacroPrefix = "### macro `"; if (markupString.startsWith(magicMacroPrefix)) { const int nameStart = magicMacroPrefix.length(); @@ -1389,6 +1390,19 @@ void ClangdClient::gatherHelpItemForTooltip(const HoverRequest::Response &hoverR return; } } + + // Is it the file path for an include directive? + QString cleanString = markupString; + cleanString.remove('`'); + const QStringList lines = cleanString.trimmed().split('\n'); + if (!lines.isEmpty()) { + const auto filePath = Utils::FilePath::fromUserInput(lines.last().simplified()); + if (filePath.exists()) { + d->setHelpItemForTooltip(hoverResponse.id(), filePath.fileName(), + HelpItem::Brief); + return; + } + } } } diff --git a/src/plugins/clangcodemodel/test/clangdtests.cpp b/src/plugins/clangcodemodel/test/clangdtests.cpp index 4a29980e662..caa48d11004 100644 --- a/src/plugins/clangcodemodel/test/clangdtests.cpp +++ b/src/plugins/clangcodemodel/test/clangdtests.cpp @@ -606,8 +606,10 @@ void ClangdTestTooltips::test() QCOMPARE(editor->document(), doc); QVERIFY(editor->editorWidget()); - if (QLatin1String(QTest::currentDataTag()) == QLatin1String("IncludeDirective")) + if (client()->versionNumber() < QVersionNumber(14) + && QLatin1String(QTest::currentDataTag()) == QLatin1String("IncludeDirective")) { QSKIP("FIXME: clangd sends empty or no hover data for includes"); + } QTimer timer; timer.setSingleShot(true); @@ -633,7 +635,6 @@ void ClangdTestTooltips::test() QEXPECT_FAIL("TypeName_ResolveTemplateTypeAlias", "typedef already resolved in AST", Abort); QCOMPARE(int(helpItem.category()), expectedCategory); QEXPECT_FAIL("TemplateClassQualified", "Additional look-up needed?", Abort); - QEXPECT_FAIL("AutoTypeTemplate", "Additional look-up needed?", Abort); QCOMPARE(helpItem.helpIds(), expectedIds); QCOMPARE(helpItem.docMark(), expectedMark); } diff --git a/src/plugins/clangcodemodel/test/data/clangtestdata.qrc b/src/plugins/clangcodemodel/test/data/clangtestdata.qrc index 47764d312b3..6655568da40 100644 --- a/src/plugins/clangcodemodel/test/data/clangtestdata.qrc +++ b/src/plugins/clangcodemodel/test/data/clangtestdata.qrc @@ -43,5 +43,6 @@ tooltips/tooltips.pro highlighting/highlighting.cpp highlighting/highlighting.pro + tooltips/subdir/tooltipinfo.h diff --git a/src/plugins/clangcodemodel/test/data/tooltips/subdir/tooltipinfo.h b/src/plugins/clangcodemodel/test/data/tooltips/subdir/tooltipinfo.h new file mode 100644 index 00000000000..47d3bb92e75 --- /dev/null +++ b/src/plugins/clangcodemodel/test/data/tooltips/subdir/tooltipinfo.h @@ -0,0 +1,3 @@ +#define MACRO_FROM_HEADER(x) x + \ + x + \ + x diff --git a/src/plugins/clangcodemodel/test/data/tooltips/tooltips.pro b/src/plugins/clangcodemodel/test/data/tooltips/tooltips.pro index d10195696e4..d5f7a749bf3 100644 --- a/src/plugins/clangcodemodel/test/data/tooltips/tooltips.pro +++ b/src/plugins/clangcodemodel/test/data/tooltips/tooltips.pro @@ -1,3 +1,4 @@ TEMPLATE = app CONFIG -= qt SOURCES = tooltips.cpp +INCLUDEPATH += subdir diff --git a/src/plugins/cpptools/cppcodeformatter.cpp b/src/plugins/cpptools/cppcodeformatter.cpp index ddd1079c326..639084a3ca6 100644 --- a/src/plugins/cpptools/cppcodeformatter.cpp +++ b/src/plugins/cpptools/cppcodeformatter.cpp @@ -559,6 +559,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block) break; case string_open: + case raw_string_open: if (!m_currentToken.isStringLiteral()) { leave(); continue; @@ -672,14 +673,14 @@ void CodeFormatter::updateLineStateChange(const QTextBlock &block) saveBlockData(&next, BlockData()); } -bool CodeFormatter::isInStringLiteral(const QTextBlock &block) const +bool CodeFormatter::isInRawStringLiteral(const QTextBlock &block) const { if (!block.previous().isValid()) return false; BlockData blockData; if (!loadBlockData(block.previous(), &blockData)) return false; - return !blockData.m_endState.isEmpty() && blockData.m_endState.top().type == string_open; + return !blockData.m_endState.isEmpty() && blockData.m_endState.top().type == raw_string_open; } CodeFormatter::State CodeFormatter::state(int belowTop) const @@ -825,7 +826,7 @@ bool CodeFormatter::tryExpression(bool alsoExpression) } if (m_currentToken.isStringLiteral()) - newState = string_open; + newState = m_currentToken.kind() == T_RAW_STRING_LITERAL ? raw_string_open : string_open; if (newState != -1) { if (alsoExpression) @@ -1439,6 +1440,7 @@ void QtStyleCodeFormatter::onEnter(int newState, int *indentDepth, int *savedInd break; case string_open: + case raw_string_open: *paddingDepth = tokenPosition - *indentDepth; break; } @@ -1481,6 +1483,7 @@ void QtStyleCodeFormatter::adjustIndent(const Tokens &tokens, int lexerState, in } break; case string_open: + case raw_string_open: if (!tokenAt(0).isStringLiteral()) { *paddingDepth = topState.savedPaddingDepth; topState = previousState; diff --git a/src/plugins/cpptools/cppcodeformatter.h b/src/plugins/cpptools/cppcodeformatter.h index 1164c12eb10..0da8061ccdc 100644 --- a/src/plugins/cpptools/cppcodeformatter.h +++ b/src/plugins/cpptools/cppcodeformatter.h @@ -57,7 +57,7 @@ public: // calculates the state change introduced by changing a single line void updateLineStateChange(const QTextBlock &block); - bool isInStringLiteral(const QTextBlock &block) const; + bool isInRawStringLiteral(const QTextBlock &block) const; void indentFor(const QTextBlock &block, int *indent, int *padding); void indentForNewLineAfter(const QTextBlock &block, int *indent, int *padding); @@ -173,8 +173,8 @@ public: // must be public to make Q_GADGET introspection work lambda_instroducer, // when '=', '&' or ',' occurred within '[]' lambda_declarator, // just after ']' when previous state is lambda_introducer lambda_statement, // just after '{' when previous state is lambda_declarator or lambda_declarator_or_expression - string_open - + string_open, // after opening quote of simple string types, like ", L", u8" etc. + raw_string_open // after raw string open delimiter, like R"EOF( }; Q_ENUM(StateType) diff --git a/src/plugins/cpptools/cppqtstyleindenter.cpp b/src/plugins/cpptools/cppqtstyleindenter.cpp index 3eebaf13210..cc3f272c450 100644 --- a/src/plugins/cpptools/cppqtstyleindenter.cpp +++ b/src/plugins/cpptools/cppqtstyleindenter.cpp @@ -99,7 +99,7 @@ void CppQtStyleIndenter::indentBlock(const QTextBlock &block, QtStyleCodeFormatter codeFormatter(tabSettings, codeStyleSettings()); codeFormatter.updateStateUntil(block); - if (codeFormatter.isInStringLiteral(block)) + if (codeFormatter.isInRawStringLiteral(block)) return; int indent; int padding; @@ -137,7 +137,7 @@ void CppQtStyleIndenter::indent(const QTextCursor &cursor, QTextCursor tc = cursor; tc.beginEditBlock(); do { - if (!codeFormatter.isInStringLiteral(block)) { + if (!codeFormatter.isInRawStringLiteral(block)) { int indent; int padding; codeFormatter.indentFor(block, &indent, &padding); diff --git a/src/plugins/languageclient/client.cpp b/src/plugins/languageclient/client.cpp index dc39fabd4e3..a3eb48ac811 100644 --- a/src/plugins/languageclient/client.cpp +++ b/src/plugins/languageclient/client.cpp @@ -655,7 +655,7 @@ void Client::documentWillSave(Core::IDocument *document) auto textDocument = qobject_cast(document); if (!m_openedDocument.contains(textDocument)) return; - bool sendMessage = true; + bool sendMessage = false; const QString method(WillSaveTextDocumentNotification::methodName); if (Utils::optional registered = m_dynamicCapabilities.isRegistered(method)) { sendMessage = registered.value(); diff --git a/src/plugins/projectexplorer/kitinformation.cpp b/src/plugins/projectexplorer/kitinformation.cpp index 60e9dcbfa8c..eb02496a326 100644 --- a/src/plugins/projectexplorer/kitinformation.cpp +++ b/src/plugins/projectexplorer/kitinformation.cpp @@ -502,11 +502,15 @@ void ToolChainKitAspect::setup(Kit *k) // ID is not found: Might be an ABI string... lockToolchains = false; const QString abi = QString::fromUtf8(id); - tc = ToolChainManager::toolChain([abi, l](const ToolChain *t) { - return t->targetAbi().toString() == abi && t->language() == l; - }); - if (tc) - setToolChain(k, tc); + QList possibleTcs = ToolChainManager::toolChains( + [abi, l](const ToolChain *t) { + return t->targetAbi().toString() == abi && t->language() == l; + }); + Utils::sort(possibleTcs, [](const ToolChain *tc1, const ToolChain *tc2) { + return tc1->hostPrefersToolchain() && !tc2->hostPrefersToolchain(); + }); + if (!possibleTcs.isEmpty()) + setToolChain(k, possibleTcs.first()); else clearToolChain(k, l); } diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 5401f51f13f..f441633741d 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -109,6 +109,15 @@ const MsvcPlatform platforms[] static QList g_availableMsvcToolchains; +static const MsvcPlatform *platformEntryFromName(const QString &name) +{ + for (const MsvcPlatform &p : platforms) { + if (name == QLatin1String(p.name)) + return &p; + } + return nullptr; +} + static const MsvcPlatform *platformEntry(MsvcToolChain::Platform t) { for (const MsvcPlatform &p : platforms) { @@ -125,27 +134,37 @@ static QString platformName(MsvcToolChain::Platform t) return QString(); } -static bool hostSupportsPlatform(MsvcToolChain::Platform platform) +static bool hostPrefersPlatform(MsvcToolChain::Platform platform) { - switch (Utils::HostOsInfo::hostArchitecture()) { - case Utils::HostOsInfo::HostArchitectureAMD64: - if (platform == MsvcToolChain::amd64 || platform == MsvcToolChain::amd64_arm - || platform == MsvcToolChain::amd64_x86 || platform == MsvcToolChain::amd64_arm64) - return true; - Q_FALLTHROUGH(); // all x86 toolchains are also working on an amd64 host - case Utils::HostOsInfo::HostArchitectureX86: + switch (HostOsInfo::hostArchitecture()) { + case HostOsInfo::HostArchitectureAMD64: + return platform == MsvcToolChain::amd64 || platform == MsvcToolChain::amd64_arm + || platform == MsvcToolChain::amd64_x86 || platform == MsvcToolChain::amd64_arm64; + case HostOsInfo::HostArchitectureX86: return platform == MsvcToolChain::x86 || platform == MsvcToolChain::x86_amd64 || platform == MsvcToolChain::x86_ia64 || platform == MsvcToolChain::x86_arm || platform == MsvcToolChain::x86_arm64; - case Utils::HostOsInfo::HostArchitectureArm: + case HostOsInfo::HostArchitectureArm: return platform == MsvcToolChain::arm; - case Utils::HostOsInfo::HostArchitectureItanium: + case HostOsInfo::HostArchitectureItanium: return platform == MsvcToolChain::ia64; default: return false; } } +static bool hostSupportsPlatform(MsvcToolChain::Platform platform) +{ + if (hostPrefersPlatform(platform)) + return true; + // The x86 host toolchains are not the preferred toolchains on amd64 but they are still + // supported by that host + return HostOsInfo::hostArchitecture() == HostOsInfo::HostArchitectureAMD64 + && (platform == MsvcToolChain::x86 || platform == MsvcToolChain::x86_amd64 + || platform == MsvcToolChain::x86_ia64 || platform == MsvcToolChain::x86_arm + || platform == MsvcToolChain::x86_arm64); +} + static QString fixRegistryPath(const QString &path) { QString result = QDir::fromNativeSeparators(path); @@ -985,6 +1004,11 @@ std::unique_ptr MsvcToolChain::createConfigurationWidget( return std::make_unique(this); } +bool MsvcToolChain::hostPrefersToolchain() const +{ + return hostPrefersPlatform(platform()); +} + bool static hasFlagEffectOnMacros(const QString &flag) { if (flag.startsWith("-") || flag.startsWith("/")) { @@ -1212,6 +1236,15 @@ void MsvcToolChain::resetVarsBat() m_varsBatArg.clear(); } +MsvcToolChain::Platform MsvcToolChain::platform() const +{ + QStringList args = m_varsBatArg.split(' '); + if (const MsvcPlatform *entry = platformEntryFromName(args.value(0))) + return entry->platform; + return Utils::HostOsInfo::hostArchitecture() == Utils::HostOsInfo::HostArchitectureAMD64 ? amd64 + : x86; +} + // -------------------------------------------------------------------------- // MsvcBasedToolChainConfigWidget: Creates a simple GUI without error label // to display name and varsBat. Derived classes should add the error label and diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h index b74d278d593..a13afe753d2 100644 --- a/src/plugins/projectexplorer/msvctoolchain.h +++ b/src/plugins/projectexplorer/msvctoolchain.h @@ -74,6 +74,7 @@ public: bool fromMap(const QVariantMap &data) override; std::unique_ptr createConfigurationWidget() override; + bool hostPrefersToolchain() const override; MacroInspectionRunner createMacroInspectionRunner() const override; Utils::LanguageExtensions languageExtensions(const QStringList &cxxflags) const override; @@ -91,6 +92,7 @@ public: QString varsBat() const { return m_vcvarsBat; } void setupVarsBat(const Abi &abi, const QString &varsBat, const QString &varsBatArg); void resetVarsBat(); + Platform platform() const; bool operator==(const ToolChain &) const override; diff --git a/src/plugins/projectexplorer/toolchain.h b/src/plugins/projectexplorer/toolchain.h index b3ad1484c58..72c1b388bb9 100644 --- a/src/plugins/projectexplorer/toolchain.h +++ b/src/plugins/projectexplorer/toolchain.h @@ -116,6 +116,7 @@ public: virtual QString originalTargetTriple() const { return QString(); } virtual QStringList extraCodeModelFlags() const { return QStringList(); } virtual Utils::FilePath installDir() const { return Utils::FilePath(); } + virtual bool hostPrefersToolchain() const { return true; } virtual bool isValid() const; diff --git a/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.ui b/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.ui index b3a9a85e6c9..04f41b7cd91 100644 --- a/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.ui +++ b/src/plugins/qmldesigner/components/annotationeditor/annotationcommenttab.ui @@ -28,6 +28,9 @@ true + + QComboBox::NoInsert + diff --git a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp index c26e029f548..5292c2f1999 100644 --- a/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp +++ b/src/plugins/qmldesigner/components/componentcore/designeractionmanager.cpp @@ -27,6 +27,7 @@ #include "changestyleaction.h" #include "designeractionmanagerview.h" +#include "designermcumanager.h" #include "formatoperation.h" #include "modelnodecontextmenu_helper.h" #include "qmldesignerconstants.h" @@ -633,6 +634,11 @@ bool selectionCanBeLayoutedAndQtQuickLayoutPossible(const SelectionContext &cont return selectionCanBeLayouted(context) && context.view()->majorQtQuickVersion() > 1; } +bool selectionCanBeLayoutedAndQtQuickLayoutPossibleAndNotMCU(const SelectionContext &context) +{ + return selectionCanBeLayoutedAndQtQuickLayoutPossible(context) && !DesignerMcuManager::instance().isMCUProject(); +} + bool selectionNotEmptyAndHasZProperty(const SelectionContext &context) { return selectionNotEmpty(context) && selectionHasProperty(context, zProperty); @@ -1360,7 +1366,7 @@ void DesignerActionManager::createDefaultDesignerActions() QKeySequence("shift+g"), 60, &layoutGridLayout, - &selectionCanBeLayoutedAndQtQuickLayoutPossible)); + &selectionCanBeLayoutedAndQtQuickLayoutPossibleAndNotMCU)); addDesignerAction(new SeperatorDesignerAction(layoutCategory, 50)); diff --git a/src/plugins/qmldesigner/components/componentcore/layoutingridlayout.cpp b/src/plugins/qmldesigner/components/componentcore/layoutingridlayout.cpp index e106fc93579..f55f4807d91 100644 --- a/src/plugins/qmldesigner/components/componentcore/layoutingridlayout.cpp +++ b/src/plugins/qmldesigner/components/componentcore/layoutingridlayout.cpp @@ -325,8 +325,10 @@ void LayoutInGridLayout::calculateGridOffsets() removeSimilarValues(m_yTopOffsets, heightTolerance); //The first offset is not important, because it just defines the beginning of the layout - m_xTopOffsets.removeFirst(); - m_yTopOffsets.removeFirst(); + if (!m_xTopOffsets.isEmpty()) + m_xTopOffsets.removeFirst(); + if (!m_yTopOffsets.isEmpty()) + m_yTopOffsets.removeFirst(); } void LayoutInGridLayout::removeEmtpyRowsAndColumns() diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp index 84ea59531bc..81066504de9 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp @@ -51,7 +51,7 @@ #include #include -#include +#include #include #include @@ -88,6 +88,7 @@ #include #include #include +#include #include @@ -187,7 +188,7 @@ void toFront(const SelectionContext &selectionState) if (index != lastIndex) parentProperty.slide(index, lastIndex); } - } catch (const RewritingException &e) { //better save then sorry + } catch (const RewritingException &e) { //better safe than sorry e.showException(); } } @@ -208,7 +209,7 @@ void toBack(const SelectionContext &selectionState) parentProperty.slide(index, 0); } - } catch (const RewritingException &e) { //better save then sorry + } catch (const RewritingException &e) { //better safe than sorry e.showException(); } } @@ -272,7 +273,7 @@ void setVisible(const SelectionContext &selectionState) try { selectionState.selectedModelNodes().constFirst().variantProperty("visible").setValue(selectionState.toggled()); - } catch (const RewritingException &e) { //better save then sorry + } catch (const RewritingException &e) { //better safe than sorry e.showException(); } } @@ -285,7 +286,7 @@ void setFillWidth(const SelectionContext &selectionState) try { selectionState.firstSelectedModelNode().variantProperty("Layout.fillWidth").setValue(selectionState.toggled()); - } catch (const RewritingException &e) { //better save then sorry + } catch (const RewritingException &e) { //better safe than sorry e.showException(); } } @@ -298,7 +299,7 @@ void setFillHeight(const SelectionContext &selectionState) try { selectionState.firstSelectedModelNode().variantProperty("Layout.fillHeight").setValue(selectionState.toggled()); - } catch (const RewritingException &e) { //better save then sorry + } catch (const RewritingException &e) { //better safe than sorry e.showException(); } } @@ -522,9 +523,14 @@ void layoutFlowPositioner(const SelectionContext &selectionContext) void layoutRowLayout(const SelectionContext &selectionContext) { try { - LayoutInGridLayout::ensureLayoutImport(selectionContext); - layoutHelperFunction(selectionContext, "QtQuick.Layouts.RowLayout", compareByX); - } catch (RewritingException &e) { //better save then sorry + if (DesignerMcuManager::instance().isMCUProject()) { + layoutHelperFunction(selectionContext, "QtQuick.Row", compareByX); + } + else { + LayoutInGridLayout::ensureLayoutImport(selectionContext); + layoutHelperFunction(selectionContext, "QtQuick.Layouts.RowLayout", compareByX); + } + } catch (RewritingException &e) { //better safe than sorry e.showException(); } } @@ -532,9 +538,14 @@ void layoutRowLayout(const SelectionContext &selectionContext) void layoutColumnLayout(const SelectionContext &selectionContext) { try { - LayoutInGridLayout::ensureLayoutImport(selectionContext); - layoutHelperFunction(selectionContext, "QtQuick.Layouts.ColumnLayout", compareByY); - } catch (RewritingException &e) { //better save then sorry + if (DesignerMcuManager::instance().isMCUProject()) { + layoutHelperFunction(selectionContext, "QtQuick.Column", compareByX); + } + else { + LayoutInGridLayout::ensureLayoutImport(selectionContext); + layoutHelperFunction(selectionContext, "QtQuick.Layouts.ColumnLayout", compareByY); + } + } catch (RewritingException &e) { //better safe than sorry e.showException(); } } @@ -542,9 +553,16 @@ void layoutColumnLayout(const SelectionContext &selectionContext) void layoutGridLayout(const SelectionContext &selectionContext) { try { - LayoutInGridLayout::ensureLayoutImport(selectionContext); - LayoutInGridLayout::layout(selectionContext); - } catch (RewritingException &e) { //better save then sorry + Q_ASSERT(!DesignerMcuManager::instance().isMCUProject()); //remove this line when grids are finally supported + + if (DesignerMcuManager::instance().isMCUProject()) { + //qt for mcu doesn't support any grids yet + } + else { + LayoutInGridLayout::ensureLayoutImport(selectionContext); + LayoutInGridLayout::layout(selectionContext); + } + } catch (RewritingException &e) { //better safe than sorry e.showException(); } } diff --git a/src/plugins/qmldesigner/components/componentcore/theme.h b/src/plugins/qmldesigner/components/componentcore/theme.h index 4351f02c822..fcaf45e18e5 100644 --- a/src/plugins/qmldesigner/components/componentcore/theme.h +++ b/src/plugins/qmldesigner/components/componentcore/theme.h @@ -166,7 +166,8 @@ public: unpin, upDownIcon, upDownSquare2, - visibilityOff, + visibilityOffBroken, // visibilityOff + visibilityOff, // visibilityOff2 visibilityOn, wildcard, zoomAll, diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.cpp b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.cpp index 1e4fef44d21..f0bfeab9294 100644 --- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.cpp +++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryassetsmodel.cpp @@ -226,7 +226,7 @@ void ItemLibraryAssetsModel::refresh() void ItemLibraryAssetsModel::setRootPath(const QString &path) { - static const QStringList supportedTopLevelDirs {"images", "sounds", "fonts", "assets", "shaders"}; + static const QStringList ignoredTopLevelDirs {"imports", "asset_imports"}; m_fileSystemWatcher->removeDirectories(m_fileSystemWatcher->directories()); m_fileSystemWatcher->removeFiles(m_fileSystemWatcher->files()); @@ -256,7 +256,7 @@ void ItemLibraryAssetsModel::setRootPath(const QString &path) while (itDirs.hasNext()) { QDir subDir = itDirs.next(); - if (currDepth == 1 && !supportedTopLevelDirs.contains(subDir.dirName())) + if (currDepth == 1 && ignoredTopLevelDirs.contains(subDir.dirName())) continue; ItemLibraryAssetsDir *assetsDir = new ItemLibraryAssetsDir(subDir.path(), currDepth, loadExpandedState(subDir.path()), currAssetsDir); diff --git a/src/plugins/qtsupport/qtkitinformation.cpp b/src/plugins/qtsupport/qtkitinformation.cpp index 54f61ec5912..002c49f7fc0 100644 --- a/src/plugins/qtsupport/qtkitinformation.cpp +++ b/src/plugins/qtsupport/qtkitinformation.cpp @@ -236,7 +236,11 @@ void QtKitAspect::fix(Kit *k) const QVector &qtAbis = version->qtAbis(); const bool tc1ExactMatch = qtAbis.contains(tc1->targetAbi()); const bool tc2ExactMatch = qtAbis.contains(tc2->targetAbi()); - return tc1ExactMatch && !tc2ExactMatch; + if (tc1ExactMatch && !tc2ExactMatch) + return true; + if (!tc1ExactMatch && tc2ExactMatch) + return false; + return tc1->hostPrefersToolchain() && !tc2->hostPrefersToolchain(); }); const QList goodTcs = Utils::filtered(possibleTcs, diff --git a/tests/unit/unittest/benchmark_dependency.pri b/tests/unit/unittest/benchmark_dependency.pri index e9e0408530a..d5a0b205583 100644 --- a/tests/unit/unittest/benchmark_dependency.pri +++ b/tests/unit/unittest/benchmark_dependency.pri @@ -14,6 +14,7 @@ GOOGLEBENCHMARK_DIR = $$(GOOGLEBENCHMARK_DIR) $$GOOGLEBENCHMARK_DIR/src/counter.cc \ $$GOOGLEBENCHMARK_DIR/src/csv_reporter.cc \ $$GOOGLEBENCHMARK_DIR/src/json_reporter.cc \ + $$GOOGLEBENCHMARK_DIR/src/perf_counters.cc \ $$GOOGLEBENCHMARK_DIR/src/reporter.cc \ $$GOOGLEBENCHMARK_DIR/src/sleep.cc \ $$GOOGLEBENCHMARK_DIR/src/statistics.cc \ @@ -21,5 +22,5 @@ GOOGLEBENCHMARK_DIR = $$(GOOGLEBENCHMARK_DIR) $$GOOGLEBENCHMARK_DIR/src/sysinfo.cc \ $$GOOGLEBENCHMARK_DIR/src/timers.cc - win32:LIBS += -lShlwapi + win32:LIBS += -lshlwapi }