diff --git a/CMakeLists.txt b/CMakeLists.txt index 4da4284a495..d2359e6a21c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,7 +89,9 @@ endif() # Crashpad set(CRASHPAD_BACKEND_URL "" CACHE STRING "Crashpad backend URL") set(BUILD_WITH_CRASHPAD OFF) -if(CRASHPAD_BACKEND_URL AND (WIN32 OR APPLE)) # Linux is not supported for now +# Linux is not supported for now +# x86_64;arm64 is not supported for now +if(CRASHPAD_BACKEND_URL AND (WIN32 OR (APPLE AND NOT "${CMAKE_OSX_ARCHITECTURES}" STREQUAL "x86_64;arm64"))) find_package(Crashpad QUIET) if(TARGET Crashpad::Crashpad) set(BUILD_WITH_CRASHPAD ON) diff --git a/dist/copyright_template.txt b/dist/copyright_template.txt index a825d83797c..dbe14342561 100644 --- a/dist/copyright_template.txt +++ b/dist/copyright_template.txt @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2021 The Qt Company Ltd. +** Copyright (C) 2022 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of Qt Creator. diff --git a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-editor.qdoc b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-editor.qdoc index 7b147fe684a..dee9a01a9d9 100644 --- a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-editor.qdoc +++ b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-editor.qdoc @@ -279,6 +279,11 @@ \li Always Show Camera Frustums \li Toggles between always showing the camera frustum and showing it only for cameras selected in \uicontrol {3D Editor}. + \row + \li Always Show Particle Emitters and Attractors + \li Toggle between always showing the particle emitter and attractor + visualizations and only showing them when the emitter or attractor is + selected in \uicontrol {3D Editor}. \endtable \section1 Particle Editor diff --git a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-particles.qdoc b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-particles.qdoc index 7f81f8f2de4..6f768c6bd24 100644 --- a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-particles.qdoc +++ b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-particles.qdoc @@ -729,8 +729,9 @@ \l {Model Shape} component to use. The shape is scaled, positioned, and rotated based on the emitter node properties. When the shape \uicontrol Fill property is set to false, particles are emitted only from the surface of the - shape. When the shape is not defined, particles are emitted from the center - point of the emitter. + shape. When the shape is defined, it is visualized in + \uicontrol {3D Editor}. When the shape is not defined, particles are emitted + from the center point of the emitter. In \uicontrol {Life span}, specify the lifespan of a single particle in milliseconds. Specify variation in the particle lifespan in @@ -883,7 +884,8 @@ In \uicontrol Shape, select an instance of the \l {Particle Shape} or \l {Model Shape} component to attract particles into a random position - inside the shape. + inside the shape. When the shape is defined, it is visualized in + \uicontrol {3D Editor}. \uicontrol Duration specifies the duration in milliseconds that it takes for particles to reach the attraction position. When the value is -1, diff --git a/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml b/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml index f895cdd8c40..0ce7e633022 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml @@ -265,7 +265,7 @@ Item { anchors.fill: parent anchors.margins: DialogValues.gridMargins - NewProjectView { + PresetView { id: presetView anchors.fill: parent diff --git a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/NewProjectView.qml b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/PresetView.qml similarity index 100% rename from share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/NewProjectView.qml rename to share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/PresetView.qml diff --git a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Styles.qml b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Styles.qml index 2f8da50c6c3..5e1a25cb9d0 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Styles.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Styles.qml @@ -140,6 +140,7 @@ Item { id: delegateId width: stylesList.width height: DialogValues.styleListItemHeight + hoverEnabled: true onClicked: stylesList.currentIndex = index @@ -161,13 +162,13 @@ Item { height: DialogValues.styleImageHeight + 2 * DialogValues.styleImageBorderWidth - border.color: itemRectMouseArea.containsMouse + border.color: delegateId.hovered ? DialogValues.textColor : (index === stylesList.currentIndex ? DialogValues.textColorInteraction : "transparent") - border.width: index === stylesList.currentIndex || itemRectMouseArea.containsMouse + border.width: index === stylesList.currentIndex || delegateId.hovered ? DialogValues.styleImageBorderWidth : 0 @@ -182,12 +183,6 @@ Item { asynchronous: false source: "image://newprojectdialog_library/" + BackendApi.styleModel.iconId(model.index) } - - MouseArea { - id: itemRectMouseArea - anchors.fill: parent - hoverEnabled: true - } } // Rectangle Text { diff --git a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/qmldir b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/qmldir index 996b9ec3561..2cabd989f34 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/qmldir +++ b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/qmldir @@ -3,5 +3,5 @@ PopupDialogButton 1.0 PopupDialogButton.qml PopupDialogButtonBox 1.0 PopupDialogButtonBox.qml Details 1.0 Details.qml singleton DialogValues 1.0 DialogValues.qml -NewProjectView 1.0 NewProjectView.qml +PresetView 1.0 PresetView.qml Styles 1.0 Styles.qml diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Window/WindowSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Window/WindowSpecifics.qml index 0e2e086a819..a5b73b9e39f 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Window/WindowSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Window/WindowSpecifics.qml @@ -26,6 +26,7 @@ import QtQuick 2.15 import QtQuick.Layouts 1.15 import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls import StudioTheme 1.0 as StudioTheme Section { @@ -47,6 +48,40 @@ Section { ExpandingSpacer {} } + PropertyLabel { text: qsTr("Position") } + + SecondColumnLayout { + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.x + maximumValue: 0xffff + minimumValue: -0xffff + decimals: 0 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { text: "X" } + + Spacer { implicitWidth: StudioTheme.Values.controlGap } + + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.y + maximumValue: 0xffff + minimumValue: -0xffff + decimals: 0 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { text: "Y" } + + ExpandingSpacer {} + } + PropertyLabel { text: qsTr("Size") } SecondColumnLayout { @@ -87,6 +122,92 @@ Section { ExpandingSpacer {} } + PropertyLabel { + text: qsTr("Minimum size") + tooltip: qsTr("Minimum size of the window.") + } + + SecondColumnLayout { + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.minimumWidth + minimumValue: 0 + maximumValue: 0xffff + decimals: 0 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { + //: The width of the object + text: qsTr("W", "width") + } + + Spacer { implicitWidth: StudioTheme.Values.controlGap } + + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.minimumHeight + minimumValue: 0 + maximumValue: 0xffff + decimals: 0 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { + //: The height of the object + text: qsTr("H", "height") + } + + ExpandingSpacer {} + } + + PropertyLabel { + text: qsTr("Maximum size") + tooltip: qsTr("Maximum size of the window.") + } + + SecondColumnLayout { + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.maximumWidth + minimumValue: 0 + maximumValue: 0xffff + decimals: 0 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { + //: The width of the object + text: qsTr("W", "width") + } + + Spacer { implicitWidth: StudioTheme.Values.controlGap } + + SpinBox { + implicitWidth: StudioTheme.Values.twoControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + backendValue: backendValues.maximumHeight + minimumValue: 0 + maximumValue: 0xffff + decimals: 0 + } + + Spacer { implicitWidth: StudioTheme.Values.controlLabelGap } + + ControlLabel { + //: The height of the object + text: qsTr("H", "height") + } + + ExpandingSpacer {} + } + PropertyLabel { text: qsTr("Color") } ColorEditor { @@ -122,5 +243,316 @@ Section { ExpandingSpacer {} } + + PropertyLabel { text: qsTr("Content orientation") } + + SecondColumnLayout { + StudioControls.ComboBox { + id: contentOrientationComboBox + + property bool __isCompleted: false + + property variant backendValue: backendValues.contentOrientation + property variant valueFromBackend: contentOrientationComboBox.backendValue?.value ?? 0 + property bool isInModel: contentOrientationComboBox.backendValue?.isInModel ?? false + property bool isInSubState: contentOrientationComboBox.backendValue?.isInSubState ?? false + property bool block: false + + onIsInModelChanged: contentOrientationComboBox.evaluateValue() + onIsInSubStateChanged: contentOrientationComboBox.evaluateValue() + onBackendValueChanged: contentOrientationComboBox.evaluateValue() + onValueFromBackendChanged: contentOrientationComboBox.evaluateValue() + + Connections { + target: modelNodeBackend + function onSelectionChanged() { contentOrientationComboBox.evaluateValue() } + } + + function indexOfContentOrientation() { + if (contentOrientationComboBox.backendValue === undefined + || contentOrientationComboBox.backendValue.expression === undefined) + return 0 + + let value = contentOrientationComboBox.backendValue.expression + + if (value.indexOf("PrimaryOrientation") !== -1) return 0 + if (value.indexOf("LandscapeOrientation") !== -1) return 1 + if (value.indexOf("PortraitOrientation") !== -1) return 2 + if (value.indexOf("InvertedLandscapeOrientation") !== -1) return 3 + if (value.indexOf("InvertedPortraitOrientation") !== -1) return 4 + + return 0 + } + + function evaluateValue() { + contentOrientationComboBox.block = true + contentOrientationComboBox.currentIndex = indexOfContentOrientation() + contentOrientationComboBox.block = false + } + + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + width: implicitWidth + labelColor: contentOrientationComboBox.currentIndex === 0 + ? contentOrientationColorLogic.__defaultTextColor + : contentOrientationColorLogic.__changedTextColor + model: ["PrimaryOrientation", "LandscapeOrientation", "PortraitOrientation", + "InvertedLandscapeOrientation", "InvertedPortraitOrientation"] + + ColorLogic { id: contentOrientationColorLogic } + + actionIndicator.icon.color: contentOrientationExtFuncLogic.color + actionIndicator.icon.text: contentOrientationExtFuncLogic.glyph + actionIndicator.onClicked: contentOrientationExtFuncLogic.show() + actionIndicator.forceVisible: contentOrientationExtFuncLogic.menuVisible + actionIndicator.visible: true + + ExtendedFunctionLogic { + id: contentOrientationExtFuncLogic + backendValue: backendValues.contentOrientation + onReseted: contentOrientationComboBox.currentIndex = 0 + } + + onActivated: function(index) { + if (!contentOrientationComboBox.__isCompleted) + return + + contentOrientationComboBox.currentIndex = index + contentOrientationComboBox.composeExpressionString() + } + + function composeExpressionString() { + if (contentOrientationComboBox.block) + return + + var expressionStr = "" + if (contentOrientationComboBox.currentIndex !== 0) { + expressionStr = "Qt." + contentOrientationComboBox.currentText + contentOrientationComboBox.backendValue.expression = expressionStr + } + } + + Component.onCompleted: { + contentOrientationComboBox.evaluateValue() + contentOrientationComboBox.__isCompleted = true + } + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Flags") } + + SecondColumnLayout { + StudioControls.ComboBox { + id: flagsComboBox + + property bool __isCompleted: false + + property variant backendValue: backendValues.flags + property variant valueFromBackend: flagsComboBox.backendValue?.value ?? 0 + property bool isInModel: flagsComboBox.backendValue?.isInModel ?? false + property bool isInSubState: flagsComboBox.backendValue?.isInSubState ?? false + property bool block: false + + onIsInModelChanged: flagsComboBox.evaluateValue() + onIsInSubStateChanged: flagsComboBox.evaluateValue() + onBackendValueChanged: flagsComboBox.evaluateValue() + onValueFromBackendChanged: flagsComboBox.evaluateValue() + + Connections { + target: modelNodeBackend + function onSelectionChanged() { flagsComboBox.evaluateValue() } + } + + function indexOfFlags() { + if (flagsComboBox.backendValue === undefined + || flagsComboBox.backendValue.expression === undefined) + return 0 + + let value = flagsComboBox.backendValue.expression + + if (value.indexOf("Widget") !== -1) return 0 + if (value.indexOf("Window") !== -1) return 1 + if (value.indexOf("Dialog") !== -1) return 2 + if (value.indexOf("Sheet") !== -1) return 3 + if (value.indexOf("Drawer") !== -1) return 4 + if (value.indexOf("Popup") !== -1) return 5 + if (value.indexOf("Tool") !== -1) return 6 + if (value.indexOf("ToolTip") !== -1) return 7 + if (value.indexOf("SplashScreen") !== -1) return 8 + if (value.indexOf("Desktop") !== -1) return 9 + if (value.indexOf("SubWindow") !== -1) return 10 + if (value.indexOf("ForeignWindow") !== -1) return 11 + if (value.indexOf("CoverWindow") !== -1) return 12 + + return 0 + } + + function evaluateValue() { + flagsComboBox.block = true + flagsComboBox.currentIndex = indexOfFlags() + flagsComboBox.block = false + } + + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + width: implicitWidth + labelColor: flagsComboBox.currentIndex === 0 ? flagsColorLogic.__defaultTextColor + : flagsColorLogic.__changedTextColor + model: ["Widget", "Window", "Dialog", "Sheet", "Drawer", "Popup", "Tool", "ToolTip", + "SplashScreen", "Desktop", "SubWindow", "ForeignWindow", "CoverWindow"] + + ColorLogic { id: flagsColorLogic } + + actionIndicator.icon.color: flagsExtFuncLogic.color + actionIndicator.icon.text: flagsExtFuncLogic.glyph + actionIndicator.onClicked: flagsExtFuncLogic.show() + actionIndicator.forceVisible: flagsExtFuncLogic.menuVisible + actionIndicator.visible: true + + ExtendedFunctionLogic { + id: flagsExtFuncLogic + backendValue: backendValues.flags + onReseted: flagsComboBox.currentIndex = 0 + } + + onActivated: function(index) { + if (!flagsComboBox.__isCompleted) + return + + flagsComboBox.currentIndex = index + flagsComboBox.composeExpressionString() + } + + function composeExpressionString() { + if (flagsComboBox.block) + return + + var expressionStr = "" + if (flagsComboBox.currentIndex !== 0) { + expressionStr = "Qt." + flagsComboBox.currentText + flagsComboBox.backendValue.expression = expressionStr + } + } + + Component.onCompleted: { + flagsComboBox.evaluateValue() + flagsComboBox.__isCompleted = true + } + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Modality") } + + SecondColumnLayout { + StudioControls.ComboBox { + id: modalityComboBox + + property bool __isCompleted: false + + property variant backendValue: backendValues.modality + property variant valueFromBackend: modalityComboBox.backendValue?.value ?? 0 + property bool isInModel: modalityComboBox.backendValue?.isInModel ?? false + property bool isInSubState: modalityComboBox.backendValue?.isInSubState ?? false + property bool block: false + + onIsInModelChanged: modalityComboBox.evaluateValue() + onIsInSubStateChanged: modalityComboBox.evaluateValue() + onBackendValueChanged: modalityComboBox.evaluateValue() + onValueFromBackendChanged: modalityComboBox.evaluateValue() + + Connections { + target: modelNodeBackend + function onSelectionChanged() { modalityComboBox.evaluateValue() } + } + + function indexOfModality() { + if (modalityComboBox.backendValue === undefined + || modalityComboBox.backendValue.expression === undefined) + return 0 + + let value = modalityComboBox.backendValue.expression + + if (value.indexOf("NonModal") !== -1) return 0 + if (value.indexOf("WindowModal") !== -1) return 1 + if (value.indexOf("ApplicationModal") !== -1) return 2 + + return 0 + } + + function evaluateValue() { + modalityComboBox.block = true + modalityComboBox.currentIndex = indexOfModality() + modalityComboBox.block = false + } + + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + width: implicitWidth + labelColor: modalityComboBox.currentIndex === 0 + ? modalityColorLogic.__defaultTextColor + : modalityColorLogic.__changedTextColor + model: ["NonModal", "WindowModal", "ApplicationModal"] + + ColorLogic { id: modalityColorLogic } + + actionIndicator.icon.color: modalityExtFuncLogic.color + actionIndicator.icon.text: modalityExtFuncLogic.glyph + actionIndicator.onClicked: modalityExtFuncLogic.show() + actionIndicator.forceVisible: modalityExtFuncLogic.menuVisible + actionIndicator.visible: true + + ExtendedFunctionLogic { + id: modalityExtFuncLogic + backendValue: backendValues.modality + onReseted: modalityComboBox.currentIndex = 0 + } + + onActivated: function(index) { + if (!modalityComboBox.__isCompleted) + return + + modalityComboBox.currentIndex = index + modalityComboBox.composeExpressionString() + } + + function composeExpressionString() { + if (modalityComboBox.block) + return + + var expressionStr = "" + if (modalityComboBox.currentIndex !== 0) { + expressionStr = "Qt." + modalityComboBox.currentText + modalityComboBox.backendValue.expression = expressionStr + } + } + + Component.onCompleted: { + modalityComboBox.evaluateValue() + modalityComboBox.__isCompleted = true + } + } + + ExpandingSpacer {} + } + + PropertyLabel { text: qsTr("Visibility") } + + SecondColumnLayout { + ComboBox { + scope: "Window" + model: ["AutomaticVisibility", "Windowed", "Minimized", "Maximized", "FullScreen", + "Hidden"] + backendValue: backendValues.visibility + enabled: backendValues.visibility.isAvailable + implicitWidth: StudioTheme.Values.singleControlColumnWidth + + StudioTheme.Values.actionIndicatorWidth + } + + ExpandingSpacer {} + } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/WindowSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/WindowSpecifics.qml new file mode 100644 index 00000000000..56c45ef14d9 --- /dev/null +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/WindowSpecifics.qml @@ -0,0 +1,29 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of Qt Creator. +** +** 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 General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +import QtQuick 2.15 +import "Window" as Original + +Original.WindowSpecifics {} diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml index ea58bd71958..cd2fbf7f722 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TextField.qml @@ -54,6 +54,7 @@ T.TextField { color: StudioTheme.Values.themeTextColor selectionColor: StudioTheme.Values.themeTextSelectionColor selectedTextColor: StudioTheme.Values.themeTextSelectedTextColor + placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor readOnly: false selectByMouse: true @@ -107,6 +108,23 @@ T.TextField { height: actionIndicator.visible ? myTextField.__actionIndicatorHeight : 0 } + Text { + id: placeholder + x: myTextField.leftPadding + y: myTextField.topPadding + width: myTextField.width - (myTextField.leftPadding + myTextField.rightPadding) + height: myTextField.height - (myTextField.topPadding + myTextField.bottomPadding) + + text: myTextField.placeholderText + font: myTextField.font + color: myTextField.placeholderTextColor + verticalAlignment: myTextField.verticalAlignment + visible: !myTextField.length && !myTextField.preeditText + && (!myTextField.activeFocus || myTextField.horizontalAlignment !== Qt.AlignHCenter) + elide: Text.ElideRight + renderType: myTextField.renderType + } + background: Rectangle { id: textFieldBackground color: StudioTheme.Values.themeControlBackground @@ -138,6 +156,7 @@ T.TextField { PropertyChanges { target: myTextField color: StudioTheme.Values.themeTextColor + placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor } PropertyChanges { target: mouseArea @@ -156,6 +175,7 @@ T.TextField { PropertyChanges { target: myTextField color: StudioTheme.Values.themeTextColor + placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor } }, State { @@ -170,6 +190,7 @@ T.TextField { PropertyChanges { target: myTextField color: StudioTheme.Values.themeTextColor + placeholderTextColor: StudioTheme.Values.themePlaceholderTextColor } }, State { @@ -183,6 +204,7 @@ T.TextField { PropertyChanges { target: myTextField color: StudioTheme.Values.themeTextColor + placeholderTextColor: StudioTheme.Values.themePlaceholderTextColorInteraction } PropertyChanges { target: mouseArea @@ -200,6 +222,7 @@ T.TextField { PropertyChanges { target: myTextField color: StudioTheme.Values.themeTextColorDisabled + placeholderTextColor: StudioTheme.Values.themeTextColorDisabled } } ] diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/qmldir b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/qmldir index 3933e46d781..b5f8c7a4e30 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/qmldir +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/qmldir @@ -33,6 +33,7 @@ SliderPopup 1.0 SliderPopup.qml SpinBox 1.0 SpinBox.qml SpinBoxIndicator 1.0 SpinBoxIndicator.qml SpinBoxInput 1.0 SpinBoxInput.qml +Switch 1.0 Switch.qml TabBar 1.0 TabBar.qml TabButton 1.0 TabButton.qml TextArea 1.0 TextArea.qml diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DirectoryFontLoader.qml.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DirectoryFontLoader.qml.tpl index cf580f1b79f..600d74fecc5 100644 --- a/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DirectoryFontLoader.qml.tpl +++ b/share/qtcreator/qmldesigner/studio_templates/projects/shared-plugin/name/DirectoryFontLoader.qml.tpl @@ -33,7 +33,7 @@ import Qt.labs.folderlistmodel %{QtQuickVersion} QtObject { id: loader - property url fontDirectory: Qt.resolvedUrl("../../" + relativeFontDirectory) + property url fontDirectory: Qt.resolvedUrl("../../content/" + relativeFontDirectory) property string relativeFontDirectory: "fonts" function loadFont(url) { diff --git a/src/libs/utils/launcherinterface.cpp b/src/libs/utils/launcherinterface.cpp index 0d64c20674c..a550def367c 100644 --- a/src/libs/utils/launcherinterface.cpp +++ b/src/libs/utils/launcherinterface.cpp @@ -140,8 +140,9 @@ void LauncherInterfacePrivate::doStop() m_server->close(); QTC_ASSERT(m_process, return); m_socket->shutdown(); - m_process->waitForFinished(3000); - ProcessReaper::reap(m_process); + m_process->waitForFinished(-1); // Let the process interface finish so that it finishes + // reaping any possible processes it has started. + delete m_process; m_process = nullptr; } diff --git a/src/libs/utils/processreaper.cpp b/src/libs/utils/processreaper.cpp index 076981573d3..3ff060be548 100644 --- a/src/libs/utils/processreaper.cpp +++ b/src/libs/utils/processreaper.cpp @@ -195,6 +195,7 @@ void ProcessReaper::reap(QProcess *process, int timeoutMs) return; } + ProcessReaper::instance(); new Internal::Reaper(process, timeoutMs); } diff --git a/src/plugins/android/androidrunnerworker.cpp b/src/plugins/android/androidrunnerworker.cpp index 2adc7eaa614..5da5d99ec27 100644 --- a/src/plugins/android/androidrunnerworker.cpp +++ b/src/plugins/android/androidrunnerworker.cpp @@ -88,18 +88,15 @@ static bool isTimedOut(const chrono::high_resolution_clock::time_point &start, return timedOut; } -static qint64 extractPID(const QByteArray &output, const QString &packageName) +static qint64 extractPID(const QString &output, const QString &packageName) { qint64 pid = -1; - foreach (auto tuple, output.split('\n')) { - tuple = tuple.simplified(); - if (!tuple.isEmpty()) { - auto parts = tuple.split(':'); - QString commandName = QString::fromLocal8Bit(parts.first()); - if (parts.length() == 2 && commandName == packageName) { - pid = parts.last().toLongLong(); - break; - } + for (const QString &tuple : output.split('\n')) { + // Make sure to remove null characters which might be present in the provided output + const QStringList parts = tuple.simplified().remove('\0').split(':'); + if (parts.length() == 2 && parts.first() == packageName) { + pid = parts.last().toLongLong(); + break; } } return pid; @@ -126,7 +123,7 @@ static void findProcessPID(QFutureInterface &fi, QStringList selector, QtcProcess proc; proc.setCommand({adbPath, args}); proc.runBlocking(); - const QByteArray out = proc.allRawOutput(); + const QString out = proc.allOutput(); if (preNougat) { processPID = extractPID(out, packageName); } else { diff --git a/src/plugins/clangcodemodel/clangdclient.cpp b/src/plugins/clangcodemodel/clangdclient.cpp index 0e24f6dcba7..84e2bed10af 100644 --- a/src/plugins/clangcodemodel/clangdclient.cpp +++ b/src/plugins/clangcodemodel/clangdclient.cpp @@ -1018,9 +1018,12 @@ public: m_started = true; m_finalized = false; qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": starting"; + + // Used by ThreadedSubtaskTimer to mark the end of the whole highlighting operation + m_startTimer.restart(); } qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": subtask started at " - << QDateTime::currentDateTime().toString(); + << QDateTime::currentDateTime().time().toString("hh:mm:ss.zzz"); QTC_CHECK(!m_timer.isValid()); m_timer.start(); } @@ -1033,7 +1036,7 @@ public: if (--m_subtasks > 0) // See startSubtask(). return; qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": subtask stopped at " - << QDateTime::currentDateTime().toString(); + << QDateTime::currentDateTime().time().toString("hh:mm:ss.zzz"); QTC_CHECK(m_timer.isValid()); m_elapsedMs += m_timer.elapsed(); m_timer.invalidate(); @@ -1041,9 +1044,12 @@ public: stopTask(); } + QElapsedTimer startTimer() const { return m_startTimer; } + private: const QString m_task; QElapsedTimer m_timer; + QElapsedTimer m_startTimer; qint64 m_elapsedMs = 0; int m_subtasks = 0; bool m_started = false; @@ -1073,7 +1079,7 @@ public: class ThreadedSubtaskTimer { public: - ThreadedSubtaskTimer(const QString &task) : m_task(task) + ThreadedSubtaskTimer(const QString &task, const TaskTimer &taskTimer) : m_task(task), m_taskTimer(taskTimer) { qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": starting thread"; m_timer.start(); @@ -1083,10 +1089,15 @@ public: { qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": took " << m_timer.elapsed() << " ms in dedicated thread"; + + qCDebug(clangdLogTiming).noquote().nospace() << m_task << ": Start to end: " + << m_taskTimer.startTimer().elapsed() << " ms"; } + private: const QString m_task; QElapsedTimer m_timer; + const TaskTimer &m_taskTimer; }; class MemoryTreeModel; @@ -1212,6 +1223,13 @@ public: : LanguageClientCompletionAssistProcessor(client, snippetsGroup) , m_client(client) { + m_timer.start(); + } + + ~ClangdCompletionAssistProcessor() + { + qCDebug(clangdLogTiming).noquote().nospace() + << "ClangdCompletionAssistProcessor took: " << m_timer.elapsed() << " ms"; } private: @@ -1229,6 +1247,7 @@ private: const QList &items) const override; ClangdClient * const m_client; + QElapsedTimer m_timer; }; QList @@ -2757,9 +2776,10 @@ static void semanticHighlighter(QFutureInterface &future, const QList &tokens, const QString &docContents, const AstNode &ast, const QPointer &textDocument, - int docRevision, const QVersionNumber &clangdVersion) + int docRevision, const QVersionNumber &clangdVersion, + const TaskTimer &taskTimer) { - ThreadedSubtaskTimer t("highlighting"); + ThreadedSubtaskTimer t("highlighting", taskTimer); if (future.isCanceled()) { future.reportFinished(); return; @@ -3025,9 +3045,10 @@ void ClangdClient::Private::handleSemanticTokens(TextDocument *doc, const auto runner = [tokens, filePath = doc->filePath(), text = doc->document()->toPlainText(), ast, doc = QPointer(doc), rev = doc->document()->revision(), - clangdVersion = q->versionNumber()] { + clangdVersion = q->versionNumber(), + this] { return Utils::runAsync(semanticHighlighter, filePath, tokens, text, ast, doc, rev, - clangdVersion); + clangdVersion, highlightingTimer); }; if (isTesting) { diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index d40c3b049a6..a6c50c4632d 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -2394,8 +2394,9 @@ void EditorManagerPrivate::handleContextChange(const QList &context) // the locator line edit) first activates the window and sets focus to its focus widget. // Only afterwards the focus is shifted to the widget that received the click. d->m_scheduledCurrentEditor = editor; - QMetaObject::invokeMethod(d, &EditorManagerPrivate::setCurrentEditorFromContextChange, - Qt::QueuedConnection); + QTimer::singleShot(QApplication::doubleClickInterval() + 10, + d, + &EditorManagerPrivate::setCurrentEditorFromContextChange); } else { updateActions(); } diff --git a/src/plugins/cppeditor/doxygengenerator.cpp b/src/plugins/cppeditor/doxygengenerator.cpp index 9ab9e109eb6..23d551afc87 100644 --- a/src/plugins/cppeditor/doxygengenerator.cpp +++ b/src/plugins/cppeditor/doxygengenerator.cpp @@ -141,8 +141,10 @@ QString DoxygenGenerator::generate(QTextCursor cursor, QString DoxygenGenerator::generate(QTextCursor cursor, DeclarationAST *decl) { - if (const TemplateDeclarationAST * const templDecl = decl->asTemplateDeclaration()) + if (const TemplateDeclarationAST * const templDecl = decl->asTemplateDeclaration(); + templDecl && templDecl->declaration) { decl = templDecl->declaration; + } SpecifierAST *spec = nullptr; DeclaratorAST *decltr = nullptr; diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp index b569ce37baf..3a9a138b2a3 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp @@ -416,15 +416,6 @@ QQmlComponent *PropertyEditorContextObject::specificQmlComponent() return m_qmlComponent; } -void PropertyEditorContextObject::setGlobalBaseUrl(const QUrl &newBaseUrl) -{ - if (newBaseUrl == m_globalBaseUrl) - return; - - m_globalBaseUrl = newBaseUrl; - emit globalBaseUrlChanged(); -} - void PropertyEditorContextObject::setSpecificsUrl(const QUrl &newSpecificsUrl) { if (newSpecificsUrl == m_specificsUrl) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h index 262e9191ccb..6a3e410c8a1 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.h @@ -42,7 +42,6 @@ class PropertyEditorContextObject : public QObject { Q_OBJECT - Q_PROPERTY(QUrl globalBaseUrl READ globalBaseUrl WRITE setGlobalBaseUrl NOTIFY globalBaseUrlChanged) Q_PROPERTY(QUrl specificsUrl READ specificsUrl WRITE setSpecificsUrl NOTIFY specificsUrlChanged) Q_PROPERTY(QString specificQmlData READ specificQmlData WRITE setSpecificQmlData NOTIFY specificQmlDataChanged) @@ -68,7 +67,6 @@ class PropertyEditorContextObject : public QObject public: PropertyEditorContextObject(QObject *parent = nullptr); - QUrl globalBaseUrl() const {return m_globalBaseUrl; } QUrl specificsUrl() const {return m_specificsUrl; } QString specificQmlData() const {return m_specificQmlData; } QString stateName() const {return m_stateName; } @@ -122,7 +120,6 @@ public: bool hasAliasExport() const { return m_aliasExport; } signals: - void globalBaseUrlChanged(); void specificsUrlChanged(); void specificQmlDataChanged(); void stateNameChanged(); @@ -139,7 +136,6 @@ signals: void hasActiveTimelineChanged(); public slots: - void setGlobalBaseUrl(const QUrl &newBaseUrl); void setSpecificsUrl(const QUrl &newSpecificsUrl); @@ -161,7 +157,6 @@ public slots: void setHasAliasExport(bool hasAliasExport); private: - QUrl m_globalBaseUrl; QUrl m_specificsUrl; QString m_specificQmlData; diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index 5d6e16670e4..135bbca9dfa 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -549,8 +549,6 @@ void PropertyEditorQmlBackend::initialSetup(const TypeName &typeName, const QUrl contextObject()->setIsBaseState(true); contextObject()->setSpecificQmlData(QStringLiteral("")); - - contextObject()->setGlobalBaseUrl(QUrl()); } QString PropertyEditorQmlBackend::propertyEditorResourcesPath() diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp index 7c2b3230a13..383baee320e 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorview.cpp @@ -119,18 +119,13 @@ void PropertyEditorView::setupPane(const TypeName &typeName) if (!qmlBackend) { qmlBackend = new PropertyEditorQmlBackend(this); - qmlBackend->context()->setContextProperty("finishedNotify", QVariant(false) ); qmlBackend->initialSetup(typeName, qmlSpecificsFile, this); qmlBackend->setSource(qmlFile); - qmlBackend->context()->setContextProperty("finishedNotify", QVariant(true) ); m_stackedWidget->addWidget(qmlBackend->widget()); m_qmlBackendHash.insert(qmlFile.toString(), qmlBackend); } else { - qmlBackend->context()->setContextProperty("finishedNotify", QVariant(false) ); - qmlBackend->initialSetup(typeName, qmlSpecificsFile, this); - qmlBackend->context()->setContextProperty("finishedNotify", QVariant(true) ); } } @@ -499,14 +494,12 @@ void PropertyEditorView::setupQmlBackend() } else { qmlObjectNode.reset(new QmlObjectNode); } - currentQmlBackend->context()->setContextProperty("finishedNotify", QVariant(false)); + if (specificQmlData.isEmpty()) currentQmlBackend->contextObject()->setSpecificQmlData(specificQmlData); - currentQmlBackend->contextObject()->setGlobalBaseUrl(qmlFile); currentQmlBackend->contextObject()->setSpecificQmlData(specificQmlData); currentQmlBackend->setSource(qmlFile); - currentQmlBackend->context()->setContextProperty("finishedNotify", QVariant(true)); } else { QScopedPointer qmlObjectNode; if (m_selectedNode.isValid()) @@ -514,18 +507,14 @@ void PropertyEditorView::setupQmlBackend() else qmlObjectNode.reset(new QmlObjectNode); - currentQmlBackend->context()->setContextProperty("finishedNotify", QVariant(false)); if (specificQmlData.isEmpty()) currentQmlBackend->contextObject()->setSpecificQmlData(specificQmlData); currentQmlBackend->setup(*qmlObjectNode, currentStateName, qmlSpecificsFile, this); - currentQmlBackend->contextObject()->setGlobalBaseUrl(qmlFile); currentQmlBackend->contextObject()->setSpecificQmlData(specificQmlData); } m_stackedWidget->setCurrentWidget(currentQmlBackend->widget()); - currentQmlBackend->context()->setContextProperty("finishedNotify", QVariant(true)); - currentQmlBackend->contextObject()->triggerSelectionChanged(); m_qmlBackEndForCurrentType = currentQmlBackend; diff --git a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp index 09450cdb7ca..35b74111d1e 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp @@ -91,31 +91,4 @@ void Quick2PropertyEditorView::registerQmlTypes() } } -bool Quick2PropertyEditorView::event(QEvent *e) -{ - static std::vector overrideSequences = { QKeySequence(Qt::SHIFT + Qt::Key_Up), - QKeySequence(Qt::SHIFT + Qt::Key_Down), - QKeySequence(Qt::CTRL + Qt::Key_Up), - QKeySequence(Qt::CTRL + Qt::Key_Down) - }; - - if (e->type() == QEvent::ShortcutOverride) { - auto keyEvent = static_cast(e); - - static const Qt::KeyboardModifiers relevantModifiers = Qt::ShiftModifier - | Qt::ControlModifier - | Qt::AltModifier - | Qt::MetaModifier; - - QKeySequence keySqeuence(keyEvent->key() | (keyEvent->modifiers() & relevantModifiers)); - for (const QKeySequence &overrideSequence : overrideSequences) - if (keySqeuence.matches(overrideSequence)) { - keyEvent->accept(); - return true; - } - } - - return QQuickWidget::event(e); -} - } //QmlDesigner diff --git a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h index c2c0ba9f36f..7bfc6f15580 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h +++ b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.h @@ -38,9 +38,6 @@ public: explicit Quick2PropertyEditorView(QWidget *parent = nullptr); static void registerQmlTypes(); - -protected: - bool event(QEvent *e) override; }; } //QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp index c49a8c5035b..322adb7b4cf 100644 --- a/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp +++ b/src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp @@ -30,10 +30,16 @@ #include "iwidgetplugin.h" #include +#include + +#include + #include "pluginmanager/widgetpluginmanager.h" #include #include +#include +#include #include enum { @@ -43,6 +49,30 @@ enum { namespace QmlDesigner { namespace Internal { + +static QString globalMetaInfoPath() +{ +#ifdef SHARE_QML_PATH + if (qEnvironmentVariableIsSet("LOAD_QML_FROM_SOURCE")) + return QLatin1String(SHARE_QML_PATH) + "/globalMetaInfo"; +#endif + return Core::ICore::resourcePath("qmldesigner/globalMetaInfo").toString(); +} + +Utils::FilePaths allGlobalMetaInfoFiles() +{ + static Utils::FilePaths paths; + + if (!paths.isEmpty()) + return paths; + + QDirIterator it(globalMetaInfoPath(), { "*.metainfo" }, QDir::Files, QDirIterator::Subdirectories); + while (it.hasNext()) + paths.append(Utils::FilePath::fromString(it.next())); + + return paths; +} + class MetaInfoPrivate { Q_DISABLE_COPY(MetaInfoPrivate) @@ -99,6 +129,19 @@ void MetaInfoPrivate::parseItemLibraryDescriptions() errorMessage); } } + + const Utils::FilePaths allMetaInfoFiles = allGlobalMetaInfoFiles(); + for (const Utils::FilePath &path : allMetaInfoFiles) { + Internal::MetaInfoReader reader(*m_q); + try { + reader.readMetaInfoFile(path.toString()); + } catch (const InvalidMetaInfoException &e) { + qWarning() << e.description(); + const QString errorMessage = path.toString() + QLatin1Char('\n') + QLatin1Char('\n') + reader.errors().join(QLatin1Char('\n')); + Core::AsynchronousMessageBox::warning(QCoreApplication::translate("QmlDesigner::Internal::MetaInfoPrivate", "Invalid meta info"), + errorMessage); + } + } #endif } diff --git a/src/plugins/qmldesigner/designercore/model/modelnode.cpp b/src/plugins/qmldesigner/designercore/model/modelnode.cpp index c6851548759..fe3d0cf1e1b 100644 --- a/src/plugins/qmldesigner/designercore/model/modelnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/modelnode.cpp @@ -196,7 +196,8 @@ static bool isIdToAvoid(const QString& id) "texture", "shaderInfo", "sprite", - "spriteSequence" + "spriteSequence", + "baseState" }; return ids.contains(id); diff --git a/src/plugins/qmldesigner/designercore/model/qmlvisualnode.cpp b/src/plugins/qmldesigner/designercore/model/qmlvisualnode.cpp index d6f417407c1..f8044fd6da1 100644 --- a/src/plugins/qmldesigner/designercore/model/qmlvisualnode.cpp +++ b/src/plugins/qmldesigner/designercore/model/qmlvisualnode.cpp @@ -335,7 +335,7 @@ QmlObjectNode QmlVisualNode::createQmlObjectNode(AbstractView *view, if (!newQmlObjectNode.isValid()) return; - newQmlObjectNode.setId(view->model()->generateNewId(itemLibraryEntry.name())); + newQmlObjectNode.modelNode().setIdWithoutRefactoring(view->model()->generateNewId(itemLibraryEntry.name())); for (const auto &propertyBindingEntry : propertyBindingList) newQmlObjectNode.modelNode().bindingProperty(propertyBindingEntry.first).setExpression(propertyBindingEntry.second); diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp index d9c369e3dd8..ad3c1693304 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp @@ -958,6 +958,12 @@ static QList generatePossibleLibraryImports(const QHash= 0) { int minorVersion = (importKey.minorVersion == LanguageUtils::ComponentVersion::NoVersion) ? 0 : importKey.minorVersion; + + if (libraryName.contains("QtQuick.Studio")) { + majorVersion = 1; + minorVersion = 0; + } + QString version = QStringLiteral("%1.%2").arg(majorVersion).arg(minorVersion); if (!libraryName.endsWith(".impl")) possibleImports.append(QmlDesigner::Import::createLibraryImport(libraryName, version)); diff --git a/src/plugins/qmldesigner/studioplugin/studioplugin.metainfo b/src/plugins/qmldesigner/studioplugin/studioplugin.metainfo index aca27866ac4..207cdbb9773 100644 --- a/src/plugins/qmldesigner/studioplugin/studioplugin.metainfo +++ b/src/plugins/qmldesigner/studioplugin/studioplugin.metainfo @@ -26,7 +26,14 @@ MetaInfo { "QtQuick.Controls.Imagine", "QtQuick.Controls.Universal", "QtQuick.Controls.Material", - "QtQuick.Controls.NativeStyle" + "QtQuick.Controls.NativeStyle", + "QtQuick.NativeStyle", + "QtRemoteObjects", + "Qt5Compat.GraphicalEffects", + "QtQuick.Templates", + "QtQuick.Shapes", + "QtQuick.Studio.EventSystem", + "QtQuick.Studio.EventSimulator" ] showTagsForImports: [ diff --git a/src/plugins/studiowelcome/qdsnewdialog.cpp b/src/plugins/studiowelcome/qdsnewdialog.cpp index 527204c80e8..943ca0be328 100644 --- a/src/plugins/studiowelcome/qdsnewdialog.cpp +++ b/src/plugins/studiowelcome/qdsnewdialog.cpp @@ -99,6 +99,8 @@ QdsNewDialog::QdsNewDialog(QWidget *parent) QObject::connect(&m_wizard, &WizardHandler::statusMessageChanged, this, &QdsNewDialog::onStatusMessageChanged); QObject::connect(&m_wizard, &WizardHandler::projectCanBeCreated, this, &QdsNewDialog::onProjectCanBeCreatedChanged); + m_dialog->installEventFilter(this); + QObject::connect(&m_wizard, &WizardHandler::wizardCreationFailed, this, [this]() { QMessageBox::critical(m_dialog, tr("New project"), tr("Failed to initialize data")); reject(); @@ -110,6 +112,17 @@ QdsNewDialog::QdsNewDialog(QWidget *parent) }); } +bool QdsNewDialog::eventFilter(QObject *obj, QEvent *event) +{ + if (obj == m_dialog && event->type() == QEvent::KeyPress + && static_cast(event)->key() == Qt::Key_Escape) { + reject(); + return true; + } + + return false; +} + void QdsNewDialog::onDeletingWizard() { m_screenSizeModel->setBackendModel(nullptr); diff --git a/src/plugins/studiowelcome/qdsnewdialog.h b/src/plugins/studiowelcome/qdsnewdialog.h index 670b39192d9..09a425c4996 100644 --- a/src/plugins/studiowelcome/qdsnewdialog.h +++ b/src/plugins/studiowelcome/qdsnewdialog.h @@ -42,6 +42,7 @@ class QStandardItemModel; QT_END_NAMESPACE namespace StudioWelcome { + class QdsNewDialog : public QObject, public Core::NewDialog { Q_OBJECT @@ -151,6 +152,7 @@ private: QString projectDescription() const { return m_qmlProjectDescription; } void updateScreenSizes(); + bool eventFilter(QObject *obj, QEvent *ev) override; private slots: void onDeletingWizard(); diff --git a/src/tools/qml2puppet/CMakeLists.txt b/src/tools/qml2puppet/CMakeLists.txt index 86d9894edaf..890cbbf5dc3 100644 --- a/src/tools/qml2puppet/CMakeLists.txt +++ b/src/tools/qml2puppet/CMakeLists.txt @@ -256,7 +256,7 @@ extend_qtc_executable(qml2puppet qmlprivategate_56.cpp qmlprivategate.h ) -if(DEFINED MULTILANGUAGE_SUPPORT_SUBDIRECTORY) +if(DEFINED MULTILANGUAGE_SUPPORT_SUBDIRECTORY AND Qt6_VERSION VERSION_GREATER_EQUAL 6.2.1) add_subdirectory(${MULTILANGUAGE_SUPPORT_SUBDIRECTORY} multilanguagesupport_static_build) endif() diff --git a/tests/system/shared/welcome.py b/tests/system/shared/welcome.py index cb11074b878..b69a28b5da8 100644 --- a/tests/system/shared/welcome.py +++ b/tests/system/shared/welcome.py @@ -46,10 +46,10 @@ def getWelcomeScreenSideBarButton(buttonLabel, isUrlButton = False): "unnamed='1'}") return __getWelcomeScreenButtonHelper__(buttonLabel, sideBar, isUrlButton) -def getWelcomeScreenMainButton(buttonLabel): - stackedWidget = waitForObject(":Qt Creator.WelcomeScreenStackedWidget") - currentStackWidget = stackedWidget.currentWidget() - return __getWelcomeScreenButtonHelper__(buttonLabel, currentStackWidget) +def getWelcomeScreenBottomButton(buttonLabel): + bottomArea = waitForObject("{type='Welcome::Internal::BottomArea' unnamed='1' " + "window=':Qt Creator_Core::Internal::MainWindow'}") + return __getWelcomeScreenButtonHelper__(buttonLabel, bottomArea, False) def getWelcomeTreeView(treeViewLabel): try: diff --git a/tests/system/suite_CSUP/tst_CSUP03/test.py b/tests/system/suite_CSUP/tst_CSUP03/test.py index a20ac19ea4f..67edd64cd18 100644 --- a/tests/system/suite_CSUP/tst_CSUP03/test.py +++ b/tests/system/suite_CSUP/tst_CSUP03/test.py @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2016 The Qt Company Ltd. +# Copyright (C) 2022 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. @@ -78,10 +78,8 @@ def main(): continue if not startCreatorVerifyingClang(useClang): continue - targetToChoose = Targets.DESKTOP_4_8_7_DEFAULT - if not qt4Available: - targetToChoose = Targets.DESKTOP_5_14_1_DEFAULT - projectName = createNewNonQtProject(tempDir(), "project-csup03", [targetToChoose]) + projectName = createNewNonQtProject(tempDir(), "project-csup03", + [Targets.DESKTOP_5_14_1_DEFAULT]) checkCodeModelSettings(useClang) openDocument("%s.Sources.main\\.cpp" % projectName) editor = getEditorForFileSuffix("main.cpp") diff --git a/tests/system/suite_WELP/tst_WELP01/test.py b/tests/system/suite_WELP/tst_WELP01/test.py index c3b7c220897..1d8eb312c21 100755 --- a/tests/system/suite_WELP/tst_WELP01/test.py +++ b/tests/system/suite_WELP/tst_WELP01/test.py @@ -25,7 +25,7 @@ source("../../shared/qtcreator.py") -getStarted = 'Get Started Now' +getStarted = 'Get Started' def clickItemVerifyHelpCombo(button, expectedHelpComboRegex, testDetails): global getStarted @@ -41,7 +41,7 @@ def clickItemVerifyHelpCombo(button, expectedHelpComboRegex, testDetails): "Verifying: '%s' button is being displayed." % getStarted) def buttonActive(button): # colors of the default theme for active button on Welcome page - (activeRed, activeGreen, activeBlue) = (64, 65, 66) + (activeRed, activeGreen, activeBlue) = (69, 206, 85) # QPalette::Window (used background color of Welcome page buttons) enumQPaletteWindow = 10 color = button.palette.color(enumQPaletteWindow) @@ -92,8 +92,8 @@ def main(): # select Projects and roughly check this switchToSubMode('Projects') - for button in ['New', 'Open']: - wsButtonFrame, wsButtonLabel = getWelcomeScreenMainButton(button) + for button in ['Create Project...', 'Open Project...']: + wsButtonFrame, wsButtonLabel = getWelcomeScreenSideBarButton(button) if test.verify(all((wsButtonFrame, wsButtonLabel)), "Verified whether '%s' button is shown." % button): test.verify(not buttonActive(wsButtonFrame), @@ -111,7 +111,7 @@ def main(): 'User Guide':'qthelp://org.qt-project.qtcreator/doc/index.html' } for text, url in textUrls.items(): - button, label = getWelcomeScreenSideBarButton(text, True) + button, label = getWelcomeScreenBottomButton(text) if test.verify(all((button, label)), "Verifying whether link button (%s) exists." % text): test.compare(str(button.toolTip), url, "Verifying URL for %s" % text) @@ -135,7 +135,7 @@ def main(): switchToSubMode('Examples') test.verify(waitForButtonsState(False, True, False), "Buttons' states have changed.") - expect = (("QTableView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'", + expect = (("QListView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'", "examples list"), ("QLineEdit", "placeholderText='Search in Examples...'", "examples search line edit"), ("QComboBox", "currentText~='.*Qt.*'", "Qt version combo box")) @@ -149,7 +149,7 @@ def main(): # select Tutorials and roughly check them switchToSubMode('Tutorials') test.verify(waitForButtonsState(False, False, True), "Buttons' states have changed.") - expect = (("QTableView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'", + expect = (("QListView", "unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'", "tutorials list"), ("QLineEdit", "placeholderText='Search in Tutorials...'", "tutorials search line edit")) diff --git a/tests/system/suite_general/tst_openqt_creator/test.py b/tests/system/suite_general/tst_openqt_creator/test.py index 6ff0bfb345e..a75be98f7ff 100644 --- a/tests/system/suite_general/tst_openqt_creator/test.py +++ b/tests/system/suite_general/tst_openqt_creator/test.py @@ -1,6 +1,6 @@ ############################################################################ # -# Copyright (C) 2016 The Qt Company Ltd. +# Copyright (C) 2022 The Qt Company Ltd. # Contact: https://www.qt.io/licensing/ # # This file is part of Qt Creator. @@ -36,10 +36,7 @@ def main(): return runButton = findObject(':*Qt Creator.Run_Core::Internal::FancyToolButton') - targetToChoose = Targets.DESKTOP_4_8_7_DEFAULT - if not qt4Available: - targetToChoose = Targets.DESKTOP_5_14_1_DEFAULT - openQmakeProject(pathSpeedcrunch, [targetToChoose]) + openQmakeProject(pathSpeedcrunch, [Targets.DESKTOP_5_14_1_DEFAULT]) # Wait for parsing to complete waitFor("runButton.enabled", 30000) # Starting before opening, because this is where Creator froze (QTCREATORBUG-10733)