From da192fb1e862ddc0e6c3a37f507c1a0fc1d236b1 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Tue, 30 Nov 2021 08:48:20 +0100 Subject: [PATCH 01/10] McuSupport: adjust more cmake variables to the 2.0 API * added missing mapping for RGL_DIR * remapped TVII_GRAPHICS_DRIVER_DIR and EK_RA6M3G_FSP_PATH * fix duplicated EVK_MIMXRT1170_FREERTOS_PATH (second one should be IMXRT1050_FREERTOS_DIR) Task-number: UL-5070 Change-Id: Ic2a69df6e5ba9a0c05f360e5e800d4c19ec966f4 Reviewed-by: Reviewed-by: Alessandro Portale --- src/plugins/mcusupport/mcusupportcmakemapper.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/mcusupport/mcusupportcmakemapper.cpp b/src/plugins/mcusupport/mcusupportcmakemapper.cpp index 8b0e05db637..34cd5782592 100644 --- a/src/plugins/mcusupport/mcusupportcmakemapper.cpp +++ b/src/plugins/mcusupport/mcusupportcmakemapper.cpp @@ -40,12 +40,15 @@ static const QHash &envVarToCMakeVarMapping() {"STM32Cube_FW_F4_SDK_PATH","QUL_BOARD_SDK_DIR"}, {"STM32Cube_FW_L4_SDK_PATH","QUL_BOARD_SDK_DIR"}, {"STM32Cube_FW_H7_SDK_PATH","QUL_BOARD_SDK_DIR"}, + {"RGL_DIR", "QUL_BOARD_SDK_DIR"}, + {"TVII_GRAPHICS_DRIVER_DIR", "QUL_BOARD_SDK_DIR"}, + {"EK_RA6M3G_FSP_PATH", "QUL_BOARD_SDK_DIR"}, {"ARMGCC_DIR", "QUL_TARGET_TOOLCHAIN_DIR"}, {"IAR_ARM_COMPILER_DIR", "QUL_TARGET_TOOLCHAIN_DIR"}, {"GHS_COMPILER_DIR", "QUL_TARGET_TOOLCHAIN_DIR"}, {"GHS_ARM_COMPILER_DIR", "QUL_TARGET_TOOLCHAIN_DIR"}, {"EVK_MIMXRT1170_FREERTOS_PATH","FREERTOS_DIR"}, - {"EVK_MIMXRT1170_FREERTOS_PATH","FREERTOS_DIR"}, + {"IMXRT1050_FREERTOS_DIR","FREERTOS_DIR"}, {"IMXRT1064_FREERTOS_DIR","FREERTOS_DIR"}, {"IMXRT595_FREERTOS_DIR","FREERTOS_DIR"}, {"STM32F7_FREERTOS_DIR", "FREERTOS_DIR"}, @@ -53,10 +56,8 @@ static const QHash &envVarToCMakeVarMapping() {"RenesasFlashProgrammer_PATH", "RENESAS_FLASH_PROGRAMMER_PATH"}, {"MCUXpressoIDE_PATH", "MCUXPRESSO_IDE_PATH"}, {"JLINK_PATH", "JLINK_PATH"}, - {"TVII_GRAPHICS_DRIVER_DIR", "TVII_GRAPHICS_DRIVER_DIR"}, {"CYPRESS_AUTO_FLASH_UTILITY_DIR", "CYPRESS_AUTO_FLASH_UTILITY_DIR"}, {"EK_RA6M3G_E2_PROJECT_PATH", "EK_RA6M3G_E2_PROJECT_PATH"}, - {"EK_RA6M3G_FSP_PATH", "EK_RA6M3G_FSP_PATH"}, }; return mapping; } From f79a93dc2b5a1f0fa182eaa67f2ef8e1024af782 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Tue, 30 Nov 2021 17:25:15 +0100 Subject: [PATCH 02/10] QmlDesigner: Hide ComboBox ScrollBar if not needed Change-Id: I1e8d9917b7b966b6c4e68459185c54dda7d21015 Reviewed-by: Thomas Hartmann Reviewed-by: --- .../imports/StudioControls/ComboBox.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml index 98fdccddb0d..bb8166326a2 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ComboBox.qml @@ -203,13 +203,15 @@ T.ComboBox { | T.Popup.CloseOnReleaseOutsideParent contentItem: ListView { + id: listView clip: true - implicitHeight: contentHeight + implicitHeight: listView.contentHeight model: myComboBox.popup.visible ? myComboBox.delegateModel : null currentIndex: myComboBox.highlightedIndex boundsBehavior: Flickable.StopAtBounds ScrollBar.vertical: ScrollBar { id: comboBoxPopupScrollBar + visible: listView.height < listView.contentHeight } } From 536f96fef8b92753b3411881fbdfec42acd239b8 Mon Sep 17 00:00:00 2001 From: Samuel Ghinet Date: Tue, 23 Nov 2021 21:05:02 +0200 Subject: [PATCH 03/10] Fix visual issues in new project wizard * Make Project name text field have the same font size as the rest * Use Titillium Web as the font family for the title * Reduce the top padding of the dialog box * Renounce the section "Advanced" from Details - we still have the items in the section, just not the section itself. * Add scrollbar for the details pane - to allow smaller size dialog * Move the tab bar (Presets) out of the GridView component - so that scrolling the view would not also scroll the header. * The Project view now shrinks if the dialog box is shrinked too much, also reduced the minimum sizes of the dialog * Resize dialog on screens smaller than 1920 x 1080 * Increase the space between Presets, Details, Styles text and their top margin * Lower the project item width from 144 to 90, so that project items in the view are not so distanced from each other. * Align the Cancel button with the left margin of the Style pane Task-number: QDS-5500 Change-Id: I340967941c5c56c89b8741079cb64e355a283e3b Reviewed-by: Qt CI Bot Reviewed-by: Thomas Hartmann --- .../newprojectdialog/NewProjectDialog.qml | 179 +++-- .../imports/NewProjectDialog/Details.qml | 660 +++++++++--------- .../imports/NewProjectDialog/DialogValues.qml | 14 +- .../NewProjectDialog/NewProjectView.qml | 54 +- .../imports/NewProjectDialog/Styles.qml | 3 +- .../newprojectdialogimageprovider.cpp | 22 +- .../newprojectdialogimageprovider.h | 1 + src/plugins/studiowelcome/qdsnewdialog.cpp | 6 +- 8 files changed, 520 insertions(+), 419 deletions(-) diff --git a/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml b/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml index 86234bf5bae..eb0cb21adf1 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/NewProjectDialog.qml @@ -34,6 +34,7 @@ import StudioControls as SC import NewProjectDialog Item { + id: rootDialog width: DialogValues.dialogWidth height: DialogValues.dialogHeight @@ -47,38 +48,53 @@ Item { Layout.alignment: Qt.AlignHCenter spacing: 0 + Item { width: parent.width; height: 20 } // spacer + Item { // Header Item Layout.fillWidth: true - implicitHeight: 218 + implicitHeight: 164 - Column { + ColumnLayout { anchors.fill: parent - Item { width: parent.width; height: 74 } // spacer - - Text { - text: qsTr("Welcome to Qt Design Studio. Let's Create Something Wonderful!") - font.pixelSize: 32 + Item { width: parent.width; implicitHeight: 20 } // spacer + Row { width: parent.width - height: 47 - lineHeight: 49 - lineHeightMode: Text.FixedHeight - color: DialogValues.textColor - horizontalAlignment: Text.AlignHCenter + height: DialogValues.dialogTitleTextHeight + Layout.alignment: Qt.AlignHCenter + Text { + text: qsTr("Welcome to ") + font.pixelSize: DialogValues.dialogTitlePixelSize + font.family: "Titillium Web" + height: DialogValues.dialogTitleTextHeight + lineHeight: DialogValues.dialogTitleLineHeight + lineHeightMode: Text.FixedHeight + color: DialogValues.textColor + } + + Text { + text: qsTr("Qt Design Studio") + font.pixelSize: DialogValues.dialogTitlePixelSize + font.family: "Titillium Web" + height: DialogValues.dialogTitleTextHeight + lineHeight: DialogValues.dialogTitleLineHeight + lineHeightMode: Text.FixedHeight + color: DialogValues.textColorInteraction + } } - Item { width: parent.width; height: 11 } // spacer - Text { width: parent.width - text: qsTr("Get started by selecting from Presets or start from empty screen. You may also include your design file.") + text: qsTr("Create new project by selecting a suitable Preset and then adjust details.") color: DialogValues.textColor font.pixelSize: DialogValues.paneTitlePixelSize lineHeight: DialogValues.paneTitleLineHeight lineHeightMode: Text.FixedHeight - horizontalAlignment: Text.AlignHCenter + Layout.alignment: Qt.AlignHCenter } - } + + Item { width: parent.width; Layout.fillHeight: true} // spacer + } // ColumnLayout } // Header Item Item { // Content Item @@ -96,7 +112,7 @@ Item { Layout.fillWidth: true Layout.fillHeight: true Layout.minimumWidth: 379 // figured out this number visually - Layout.minimumHeight: 326 // figured out this number visually + Layout.minimumHeight: 261 // figured out this number visually Column { x: DialogValues.defaultPadding // left padding @@ -106,19 +122,86 @@ Item { Text { text: qsTr("Presets") width: parent.width + height: 47 font.weight: Font.DemiBold font.pixelSize: DialogValues.paneTitlePixelSize lineHeight: DialogValues.paneTitleLineHeight lineHeightMode: Text.FixedHeight color: DialogValues.textColor + verticalAlignment: Qt.AlignVCenter } + Rectangle { // TabBar + readonly property int animDur: 500 + id: samTabRect + x: 10 // left padding + width: parent.width - 64 // right padding + height: DialogValues.projectViewHeaderHeight + color: DialogValues.lightPaneColor + + Row { + id: tabBarRow + spacing: 20 + property int currIndex: 0 + + Repeater { + model: categoryModel + Text { + text: name + font.weight: Font.DemiBold + font.pixelSize: DialogValues.viewHeaderPixelSize + verticalAlignment: Text.AlignVCenter + color: tabBarRow.currIndex === index ? DialogValues.textColorInteraction + : DialogValues.textColor + Behavior on color { ColorAnimation { duration: samTabRect.animDur } } + + MouseArea { + anchors.fill: parent + onClicked: { + tabBarRow.currIndex = index + projectModel.setPage(index) + projectViewId.currentIndex = 0 + projectViewId.currentIndexChanged() + + strip.x = parent.x + strip.width = parent.width + } + } + + } // Text + } // Repeater + } // tabBarRow + + Rectangle { + id: strip + width: tabBarRow.children[0].width + height: 5 + radius: 2 + color: DialogValues.textColorInteraction + anchors.bottom: parent.bottom + + Behavior on x { SmoothedAnimation { duration: samTabRect.animDur } } + Behavior on width { SmoothedAnimation { duration: strip.width === 0 ? 0 : samTabRect.animDur } } // do not animate initial width + } + } // Rectangle + NewProjectView { id: projectViewId x: 10 // left padding width: parent.width - 64 // right padding height: DialogValues.projectViewHeight loader: projectDetailsLoader + + Connections { + target: rootDialog + function onHeightChanged() { + if (rootDialog.height < 700) { // 700 = minimum height big dialog + projectViewId.height = DialogValues.projectViewHeight / 2 + } else { + projectViewId.height = DialogValues.projectViewHeight + } + } + } } Item { height: 5; width: parent.width } @@ -158,32 +241,46 @@ Item { Item { Layout.fillWidth: true } - SC.AbstractButton { - implicitWidth: DialogValues.dialogButtonWidth - width: DialogValues.dialogButtonWidth - visible: true - buttonIcon: qsTr("Cancel") - iconSize: DialogValues.defaultPixelSize - iconFont: StudioTheme.Constants.font + Item { // Dialog Button Box + width: DialogValues.stylesPaneWidth + height: parent.height - onClicked: { - dialogBox.reject(); - } - } + RowLayout { + width: DialogValues.stylesPaneWidth + implicitWidth: DialogValues.stylesPaneWidth + implicitHeight: parent.height - SC.AbstractButton { - implicitWidth: DialogValues.dialogButtonWidth - width: DialogValues.dialogButtonWidth - visible: true - buttonIcon: qsTr("Create") - iconSize: DialogValues.defaultPixelSize - enabled: dialogBox.fieldsValid - iconFont: StudioTheme.Constants.font + SC.AbstractButton { + implicitWidth: DialogValues.dialogButtonWidth + width: DialogValues.dialogButtonWidth + visible: true + buttonIcon: qsTr("Cancel") + iconSize: DialogValues.defaultPixelSize + iconFont: StudioTheme.Constants.font + + onClicked: { + dialogBox.reject(); + } + } + + Item { Layout.fillWidth: true } + + SC.AbstractButton { + implicitWidth: DialogValues.dialogButtonWidth + width: DialogValues.dialogButtonWidth + visible: true + buttonIcon: qsTr("Create") + iconSize: DialogValues.defaultPixelSize + enabled: dialogBox.fieldsValid + iconFont: StudioTheme.Constants.font + + onClicked: { + dialogBox.accept(); + } + } + } // RowLayout + } // Dialog Button Box - onClicked: { - dialogBox.accept(); - } - } Item { implicitWidth: 35 - DialogValues.defaultPadding } } // RowLayout } // Footer diff --git a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Details.qml b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Details.qml index 9c4f2596484..d622253a688 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Details.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Details.qml @@ -49,358 +49,385 @@ Item { Item { x: DialogValues.detailsPanePadding // left padding width: parent.width - DialogValues.detailsPanePadding * 2 // right padding + height: parent.height Column { anchors.fill: parent spacing: DialogValues.defaultPadding Text { + id: detailsHeading text: qsTr("Details") + height: DialogValues.dialogTitleTextHeight width: parent.width; font.weight: Font.DemiBold font.pixelSize: DialogValues.paneTitlePixelSize lineHeight: DialogValues.paneTitleLineHeight lineHeightMode: Text.FixedHeight color: DialogValues.textColor + verticalAlignment: Qt.AlignVCenter } - SC.TextField { - id: projectNameTextField - actionIndicatorVisible: false - translationIndicatorVisible: false - text: dialogBox.projectName + Flickable { width: parent.width - color: DialogValues.textColor - selectByMouse: true + height: parent.height - detailsHeading.height - DialogValues.defaultPadding - onEditingFinished: { - text = text.charAt(0).toUpperCase() + text.slice(1) - } + contentWidth: parent.width + contentHeight: scrollContent.height + boundsBehavior: Flickable.StopAtBounds + clip: true - font.pixelSize: DialogValues.paneTitlePixelSize - } + ScrollBar.vertical: ScrollBar { + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + implicitContentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + implicitContentHeight + topPadding + bottomPadding) - Binding { - target: dialogBox - property: "projectName" - value: projectNameTextField.text - } + property bool scrollBarVisible: parent.childrenRect.height > parent.height - Item { width: parent.width; height: DialogValues.narrowSpacing(11) } + minimumSize: orientation == Qt.Horizontal ? height / width : width / height - RowLayout { // Project location - width: parent.width + orientation: Qt.Vertical + policy: scrollBarVisible ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff + x: parent.width - width + y: 0 + height: parent.availableHeight + - (parent.bothVisible ? parent.horizontalThickness : 0) + padding: 0 - SC.TextField { - Layout.fillWidth: true - id: projectLocationTextField - actionIndicatorVisible: false - translationIndicatorVisible: false - text: dialogBox.projectLocation - color: DialogValues.textColor - selectByMouse: true - font.pixelSize: DialogValues.defaultPixelSize - } - - Binding { - target: dialogBox - property: "projectLocation" - value: projectLocationTextField.text - } - - SC.AbstractButton { - implicitWidth: 30 - iconSize: 20 - visible: true - buttonIcon: "…" - iconFont: StudioTheme.Constants.font - - onClicked: { - var newLocation = dialogBox.chooseProjectLocation() - if (newLocation) - projectLocationTextField.text = newLocation + background: Rectangle { + color: StudioTheme.Values.themeScrollBarTrack } - } // SC.AbstractButton - } // Project location RowLayout - Item { width: parent.width; height: DialogValues.narrowSpacing(7) } + contentItem: Rectangle { + implicitWidth: StudioTheme.Values.scrollBarThickness + color: StudioTheme.Values.themeScrollBarHandle + } + } // ScrollBar - RowLayout { // StatusMessage - width: parent.width - spacing: 0 + Column { + id: scrollContent + width: parent.width - DialogValues.detailsPanePadding + height: DialogValues.detailsScrollableContentHeight + spacing: DialogValues.defaultPadding - Image { - id: statusIcon - Layout.alignment: Qt.AlignTop - asynchronous: false - } + SC.TextField { + id: projectNameTextField + actionIndicatorVisible: false + translationIndicatorVisible: false + text: dialogBox.projectName + width: parent.width + color: DialogValues.textColor + selectByMouse: true - Text { - id: statusMessage - text: dialogBox.statusMessage - font.pixelSize: DialogValues.defaultPixelSize - lineHeight: DialogValues.defaultLineHeight - lineHeightMode: Text.FixedHeight - color: DialogValues.textColor - wrapMode: Text.Wrap - elide: Text.ElideRight - maximumLineCount: 3 - Layout.fillWidth: true + onEditingFinished: { + text = text.charAt(0).toUpperCase() + text.slice(1) + } - states: [ - State { - name: "warning" - when: dialogBox.statusType === "warning" - PropertyChanges { - target: statusMessage - color: DialogValues.textWarning + font.pixelSize: DialogValues.defaultPixelSize + } + + Binding { + target: dialogBox + property: "projectName" + value: projectNameTextField.text + } + + Item { width: parent.width; height: DialogValues.narrowSpacing(11) } + + RowLayout { // Project location + width: parent.width + + SC.TextField { + Layout.fillWidth: true + id: projectLocationTextField + actionIndicatorVisible: false + translationIndicatorVisible: false + text: dialogBox.projectLocation + color: DialogValues.textColor + selectByMouse: true + font.pixelSize: DialogValues.defaultPixelSize + } + + Binding { + target: dialogBox + property: "projectLocation" + value: projectLocationTextField.text + } + + SC.AbstractButton { + implicitWidth: 30 + iconSize: 20 + visible: true + buttonIcon: "…" + iconFont: StudioTheme.Constants.font + + onClicked: { + var newLocation = dialogBox.chooseProjectLocation() + if (newLocation) + projectLocationTextField.text = newLocation } - PropertyChanges { - target: statusIcon - source: "image://newprojectdialog_library/status-warning" - } - }, + } // SC.AbstractButton + } // Project location RowLayout - State { - name: "error" - when: dialogBox.statusType === "error" - PropertyChanges { - target: statusMessage - color: DialogValues.textError - } - PropertyChanges { - target: statusIcon - source: "image://newprojectdialog_library/status-error" + Item { width: parent.width; height: DialogValues.narrowSpacing(7) } + + RowLayout { // StatusMessage + width: parent.width + spacing: 0 + + Image { + id: statusIcon + Layout.alignment: Qt.AlignTop + asynchronous: false + } + + Text { + id: statusMessage + text: dialogBox.statusMessage + font.pixelSize: DialogValues.defaultPixelSize + lineHeight: DialogValues.defaultLineHeight + lineHeightMode: Text.FixedHeight + color: DialogValues.textColor + wrapMode: Text.Wrap + elide: Text.ElideRight + maximumLineCount: 3 + Layout.fillWidth: true + + states: [ + State { + name: "warning" + when: dialogBox.statusType === "warning" + PropertyChanges { + target: statusMessage + color: DialogValues.textWarning + } + PropertyChanges { + target: statusIcon + source: "image://newprojectdialog_library/status-warning" + } + }, + + State { + name: "error" + when: dialogBox.statusType === "error" + PropertyChanges { + target: statusMessage + color: DialogValues.textError + } + PropertyChanges { + target: statusIcon + source: "image://newprojectdialog_library/status-error" + } + } + ] + } // Text + } // RowLayout + + SC.CheckBox { + id: defaultLocationCheckbox + actionIndicatorVisible: false + text: qsTr("Use as default project location") + checked: false + font.pixelSize: DialogValues.defaultPixelSize + } + + Binding { + target: dialogBox + property: "saveAsDefaultLocation" + value: defaultLocationCheckbox.checked + } + + Rectangle { width: parent.width; height: 1; color: DialogValues.dividerlineColor } + + SC.ComboBox { // Screen Size ComboBox + id: screenSizeComboBox + actionIndicatorVisible: false + currentIndex: -1 + model: screenSizeModel + textRole: "display" + width: parent.width + font.pixelSize: DialogValues.defaultPixelSize + + onActivated: (index) => { + dialogBox.setScreenSizeIndex(index); + + var size = screenSizeModel.screenSizes(index); + widthField.realValue = size.width; + heightField.realValue = size.height; + } + + Connections { + target: screenSizeModel + function onModelReset() { + var newIndex = screenSizeComboBox.currentIndex > -1 + ? screenSizeComboBox.currentIndex + : dialogBox.screenSizeIndex() + + screenSizeComboBox.currentIndex = newIndex + screenSizeComboBox.activated(newIndex) } } - ] - } // Text - } // RowLayout + } // Screen Size ComboBox - SC.CheckBox { - id: defaultLocationCheckbox - actionIndicatorVisible: false - text: qsTr("Use as default project location") - checked: false - font.pixelSize: DialogValues.defaultPixelSize - } - - Binding { - target: dialogBox - property: "saveAsDefaultLocation" - value: defaultLocationCheckbox.checked - } - - Rectangle { width: parent.width; height: 1; color: DialogValues.dividerlineColor } - - SC.ComboBox { // Screen Size ComboBox - id: screenSizeComboBox - actionIndicatorVisible: false - currentIndex: -1 - model: screenSizeModel - textRole: "display" - width: parent.width - font.pixelSize: DialogValues.defaultPixelSize - - onActivated: (index) => { - dialogBox.setScreenSizeIndex(index); - - var size = screenSizeModel.screenSizes(index); - widthField.realValue = size.width; - heightField.realValue = size.height; - } - - Connections { - target: screenSizeModel - function onModelReset() { - var newIndex = screenSizeComboBox.currentIndex > -1 - ? screenSizeComboBox.currentIndex - : dialogBox.screenSizeIndex() - - screenSizeComboBox.currentIndex = newIndex - screenSizeComboBox.activated(newIndex) - } - } - } // Screen Size ComboBox - - GridLayout { // orientation + width + height - width: parent.width - height: 85 - - columns: 4 - rows: 2 - - columnSpacing: 10 - rowSpacing: 10 - - // header items - Text { - text: qsTr("Width") - font.pixelSize: DialogValues.defaultPixelSize - lineHeight: DialogValues.defaultLineHeight - lineHeightMode: Text.FixedHeight - color: DialogValues.textColor - } - - Text { - text: qsTr("Height") - font.pixelSize: DialogValues.defaultPixelSize - lineHeight: DialogValues.defaultLineHeight - lineHeightMode: Text.FixedHeight - color: DialogValues.textColor - } - - Item { Layout.fillWidth: true } - - Text { - text: qsTr("Orientation") - font.pixelSize: DialogValues.defaultPixelSize - lineHeight: DialogValues.defaultLineHeight - lineHeightMode: Text.FixedHeight - color: DialogValues.textColor - } - - // content items - SC.RealSpinBox { - id: widthField - actionIndicatorVisible: false - implicitWidth: 70 - labelColor: DialogValues.textColor - realFrom: 100 - realTo: 100000 - realValue: 100 - realStepSize: 10 - font.pixelSize: DialogValues.defaultPixelSize - - onRealValueChanged: { - var height = heightField.realValue - var width = realValue - - if (width >= height) - orientationButton.setHorizontal() - else - orientationButton.setVertical() - } - } // Width Text Field - - Binding { - target: dialogBox - property: "customWidth" - value: widthField.realValue - } - - SC.RealSpinBox { - id: heightField - actionIndicatorVisible: false - implicitWidth: 70 - labelColor: DialogValues.textColor - realFrom: 100 - realTo: 100000 - realValue: 100 - realStepSize: 10 - font.pixelSize: DialogValues.defaultPixelSize - - onRealValueChanged: { - var height = realValue - var width = widthField.realValue - - if (width >= height) - orientationButton.setHorizontal() - else - orientationButton.setVertical() - } - } // Height Text Field - - Binding { - target: dialogBox - property: "customHeight" - value: heightField.realValue - } - - Item { Layout.fillWidth: true } - - Button { - id: orientationButton - implicitWidth: 100 - implicitHeight: 50 - - checked: false - hoverEnabled: false - background: Rectangle { + GridLayout { // orientation + width + height width: parent.width - height: parent.height - color: "transparent" + height: 85 - Row { - Item { - width: orientationButton.width / 2 - height: orientationButton.height - Rectangle { - id: horizontalBar - color: "white" - width: parent.width - height: orientationButton.height / 2 - anchors.verticalCenter: parent.verticalCenter + columns: 4 + rows: 2 + + columnSpacing: 10 + rowSpacing: 10 + + // header items + Text { + text: qsTr("Width") + font.pixelSize: DialogValues.defaultPixelSize + lineHeight: DialogValues.defaultLineHeight + lineHeightMode: Text.FixedHeight + color: DialogValues.textColor + } + + Text { + text: qsTr("Height") + font.pixelSize: DialogValues.defaultPixelSize + lineHeight: DialogValues.defaultLineHeight + lineHeightMode: Text.FixedHeight + color: DialogValues.textColor + } + + Item { Layout.fillWidth: true } + + Text { + text: qsTr("Orientation") + font.pixelSize: DialogValues.defaultPixelSize + lineHeight: DialogValues.defaultLineHeight + lineHeightMode: Text.FixedHeight + color: DialogValues.textColor + } + + // content items + SC.RealSpinBox { + id: widthField + actionIndicatorVisible: false + implicitWidth: 70 + labelColor: DialogValues.textColor + realFrom: 100 + realTo: 100000 + realValue: 100 + realStepSize: 10 + font.pixelSize: DialogValues.defaultPixelSize + + onRealValueChanged: { + var height = heightField.realValue + var width = realValue + + if (width >= height) + orientationButton.setHorizontal() + else + orientationButton.setVertical() + } + } // Width Text Field + + Binding { + target: dialogBox + property: "customWidth" + value: widthField.realValue + } + + SC.RealSpinBox { + id: heightField + actionIndicatorVisible: false + implicitWidth: 70 + labelColor: DialogValues.textColor + realFrom: 100 + realTo: 100000 + realValue: 100 + realStepSize: 10 + font.pixelSize: DialogValues.defaultPixelSize + + onRealValueChanged: { + var height = realValue + var width = widthField.realValue + + if (width >= height) + orientationButton.setHorizontal() + else + orientationButton.setVertical() + } + } // Height Text Field + + Binding { + target: dialogBox + property: "customHeight" + value: heightField.realValue + } + + Item { Layout.fillWidth: true } + + Button { + id: orientationButton + implicitWidth: 100 + implicitHeight: 50 + + checked: false + hoverEnabled: false + background: Rectangle { + width: parent.width + height: parent.height + color: "transparent" + + Row { + Item { + width: orientationButton.width / 2 + height: orientationButton.height + Rectangle { + id: horizontalBar + color: "white" + width: parent.width + height: orientationButton.height / 2 + anchors.verticalCenter: parent.verticalCenter + } + } + + Item { + width: orientationButton.width / 4 + height: orientationButton.height + } + + Rectangle { + id: verticalBar + width: orientationButton.width / 4 + height: orientationButton.height + color: "white" + } } } - Item { - width: orientationButton.width / 4 - height: orientationButton.height + onClicked: { + if (widthField.realValue && heightField.realValue) { + [widthField.realValue, heightField.realValue] = [heightField.realValue, widthField.realValue]; + checked = !checked + } } - Rectangle { - id: verticalBar - width: orientationButton.width / 4 - height: orientationButton.height - color: "white" + function setHorizontal() { + checked = false + horizontalBar.color = DialogValues.textColorInteraction + verticalBar.color = "white" } - } - } - onClicked: { - if (widthField.realValue && heightField.realValue) { - [widthField.realValue, heightField.realValue] = [heightField.realValue, widthField.realValue]; - checked = !checked - } - } + function setVertical() { + checked = true + horizontalBar.color = "white" + verticalBar.color = DialogValues.textColorInteraction + } + } // Orientation button - function setHorizontal() { - checked = false - horizontalBar.color = DialogValues.textColorInteraction - verticalBar.color = "white" - } + } // GridLayout: orientation + width + height - function setVertical() { - checked = true - horizontalBar.color = "white" - verticalBar.color = DialogValues.textColorInteraction - } - } // Orientation button - - } // GridLayout: orientation + width + height - - Rectangle { width: parent.width; height: 1; color: DialogValues.dividerlineColor } - - SC.Section { - width: parent.width - caption: qsTr("Advanced") - captionPixelSize: DialogValues.defaultPixelSize - captionColor: DialogValues.darkPaneColor - captionTextColor: DialogValues.textColor - leftPadding: 0 - expanded: true - visible: dialogBox.haveVirtualKeyboard || dialogBox.haveTargetQtVersion - - Column { - spacing: DialogValues.defaultPadding - width: parent.width - - /* We need a spacer of -10 in order to have actual 18px spacing between - * section bottom and the checkbox. Otherwise, with Column spacing set to - * 18, without a spacer, the default space to the first item would be 10, - * for some reason. */ - Item { width: parent.width; height: -10 } + Rectangle { width: parent.width; height: 1; color: DialogValues.dividerlineColor } SC.CheckBox { id: useQtVirtualKeyboard @@ -440,22 +467,19 @@ Item { } } - width: parent.width - onActivated: (index) => { dialogBox.setTargetQtVersion(index) } } // Target Qt Version ComboBox - } // RowLayout - } // Column - } // SC.Section - Binding { - target: dialogBox - property: "useVirtualKeyboard" - value: useQtVirtualKeyboard.checked - } + Binding { + target: dialogBox + property: "useVirtualKeyboard" + value: useQtVirtualKeyboard.checked + } + } // ScrollContent Column + } // ScrollView } // Column } // Item diff --git a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/DialogValues.qml b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/DialogValues.qml index 4fedf879215..0dafb43e44b 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/DialogValues.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/DialogValues.qml @@ -30,12 +30,16 @@ import StudioTheme as StudioTheme QtObject { readonly property int dialogWidth: 1522 - readonly property int dialogHeight: 994 + readonly property int dialogHeight: 940 readonly property int projectViewMinimumWidth: 600 readonly property int projectViewMinimumHeight: projectViewHeight readonly property int dialogContentHeight: projectViewHeight + 300 // i.e. dialog without header and footer readonly property int loadedPanesWidth: detailsPaneWidth + stylesPaneWidth - readonly property int detailsPaneWidth: 330 + detailsPanePadding * 2 + readonly property int detailsPaneWidth: 330 + detailsPanePadding * 2// + 10 // 50 + readonly property int dialogTitleTextHeight: 47 + /* detailsScrollableContentHeight - the full height that may need to be scrolled to be fully + visible, if the dialog box is too small. */ + readonly property int detailsScrollableContentHeight: 428 readonly property int stylesPaneWidth: styleImageWidth + stylesPanePadding * 2 + styleImageBorderWidth * 2 // i.e. 240px readonly property int detailsPanePadding: 18 readonly property int stylesPanePadding: 18 @@ -44,9 +48,9 @@ QtObject { readonly property int styleImageWidth: 200 readonly property int styleImageBorderWidth: 2 readonly property int footerHeight: 73 - readonly property int projectItemWidth: 144 + readonly property int projectItemWidth: 90 readonly property int projectItemHeight: 144 - readonly property int projectViewHeight: projectItemHeight * 2 + projectViewHeaderHeight + readonly property int projectViewHeight: projectItemHeight * 2 readonly property int projectViewHeaderHeight: 38 readonly property int dialogButtonWidth: 100 @@ -69,6 +73,8 @@ QtObject { readonly property real viewHeaderLineHeight: 24 readonly property real paneTitlePixelSize: 18 readonly property real paneTitleLineHeight: 27 + readonly property int dialogTitlePixelSize: 32 + readonly property int dialogTitleLineHeight: 49 // for a spacer item function narrowSpacing(value, layoutSpacing = DialogValues.defaultPadding) { diff --git a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/NewProjectView.qml b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/NewProjectView.qml index 32a22cb1fcd..4270c0946a1 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/NewProjectView.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/NewProjectView.qml @@ -35,61 +35,9 @@ GridView { required property Item loader - readonly property int animDur: 500 - - header: Rectangle { - width: parent.width - height: DialogValues.projectViewHeaderHeight - color: DialogValues.lightPaneColor - - Row { - id: row - spacing: 20 - property int currIndex: 0 - - Repeater { - model: categoryModel - Text { - text: name - font.weight: Font.DemiBold - font.pixelSize: DialogValues.viewHeaderPixelSize - verticalAlignment: Text.AlignVCenter - color: row.currIndex === index ? DialogValues.textColorInteraction - : DialogValues.textColor - Behavior on color { ColorAnimation { duration: animDur } } - - MouseArea { - anchors.fill: parent - onClicked: { - row.currIndex = index - projectModel.setPage(index) - projectView.currentIndex = 0 - projectView.currentIndexChanged() - - strip.x = parent.x - strip.width = parent.width - } - } - - } // Text - } // Repeater - } // Row - - Rectangle { - id: strip - width: row.children[0].width - height: 5 - radius: 2 - color: DialogValues.textColorInteraction - anchors.bottom: parent.bottom - - Behavior on x { SmoothedAnimation { duration: animDur } } - Behavior on width { SmoothedAnimation { duration: strip.width === 0 ? 0 : animDur } } // do not animate initial width - } - } // Rectangle - cellWidth: DialogValues.projectItemWidth cellHeight: DialogValues.projectItemHeight + clip: true boundsBehavior: Flickable.StopAtBounds diff --git a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Styles.qml b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Styles.qml index a1ef6696f3a..09350f56010 100644 --- a/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Styles.qml +++ b/share/qtcreator/qmldesigner/newprojectdialog/imports/NewProjectDialog/Styles.qml @@ -65,12 +65,13 @@ Item { Text { id: styleTitleText text: qsTr("Style") - width: parent.width; + Layout.minimumHeight: DialogValues.dialogTitleTextHeight font.weight: Font.DemiBold font.pixelSize: DialogValues.paneTitlePixelSize lineHeight: DialogValues.paneTitleLineHeight lineHeightMode: Text.FixedHeight color: DialogValues.textColor + verticalAlignment: Qt.AlignVCenter function refresh() { text = qsTr("Style") + " (" + styleModel.rowCount() + ")" diff --git a/src/plugins/studiowelcome/newprojectdialogimageprovider.cpp b/src/plugins/studiowelcome/newprojectdialogimageprovider.cpp index bdb3e4af8be..0e502925040 100644 --- a/src/plugins/studiowelcome/newprojectdialogimageprovider.cpp +++ b/src/plugins/studiowelcome/newprojectdialogimageprovider.cpp @@ -84,6 +84,26 @@ QPixmap NewProjectDialogImageProvider::requestStylePixmap(const QString &id, QSi return pixmap; } +QPixmap NewProjectDialogImageProvider::requestDefaultPixmap(const QString &id, QSize *size, const QSize &requestedSize) +{ + QString realPath = Core::ICore::resourcePath("qmldesigner/newprojectdialog/image/" + id).toString(); + + QPixmap pixmap{realPath}; + + if (size) { + size->setWidth(pixmap.width()); + size->setHeight(pixmap.height()); + } + + if (pixmap.isNull()) + return QPixmap{}; + + if (requestedSize.isValid()) + return pixmap.scaled(requestedSize); + + return pixmap; +} + QPixmap NewProjectDialogImageProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize) { if (id.startsWith("style-")) @@ -92,7 +112,7 @@ QPixmap NewProjectDialogImageProvider::requestPixmap(const QString &id, QSize *s if (id.startsWith("status-")) return requestStatusPixmap(id, size, requestedSize); - return QPixmap{}; + return requestDefaultPixmap(id, size, requestedSize); } } // namespace Internal diff --git a/src/plugins/studiowelcome/newprojectdialogimageprovider.h b/src/plugins/studiowelcome/newprojectdialogimageprovider.h index f149d082c21..00640702590 100644 --- a/src/plugins/studiowelcome/newprojectdialogimageprovider.h +++ b/src/plugins/studiowelcome/newprojectdialogimageprovider.h @@ -41,6 +41,7 @@ public: private: QPixmap requestStatusPixmap(const QString &id, QSize *size, const QSize &requestedSize); QPixmap requestStylePixmap(const QString &id, QSize *size, const QSize &requestedSize); + QPixmap requestDefaultPixmap(const QString &id, QSize *size, const QSize &requestedSize); static QPixmap invalidStyleIcon(); }; diff --git a/src/plugins/studiowelcome/qdsnewdialog.cpp b/src/plugins/studiowelcome/qdsnewdialog.cpp index 7ab0d9f8c13..6492bb85791 100644 --- a/src/plugins/studiowelcome/qdsnewdialog.cpp +++ b/src/plugins/studiowelcome/qdsnewdialog.cpp @@ -93,7 +93,11 @@ QdsNewDialog::QdsNewDialog(QWidget *parent) m_dialog->setWindowModality(Qt::ApplicationModal); m_dialog->setWindowFlags(Qt::Dialog); m_dialog->setAttribute(Qt::WA_DeleteOnClose); - m_dialog->setMinimumSize(1155, 804); + m_dialog->setMinimumSize(1110, 554); + + QSize screenSize = m_dialog->screen()->geometry().size(); + if (screenSize.height() < 1080) + m_dialog->resize(parent->size()); QObject::connect(&m_wizard, &WizardHandler::deletingWizard, this, &QdsNewDialog::onDeletingWizard); QObject::connect(&m_wizard, &WizardHandler::wizardCreated, this, &QdsNewDialog::onWizardCreated); From b4eb6ff4dda15e10d79c46a669f1586ea8fdeb36 Mon Sep 17 00:00:00 2001 From: Christiaan Janssen Date: Tue, 30 Nov 2021 16:13:11 +0100 Subject: [PATCH 04/10] McuSupport: fix armgdb registration when creating kit Task-number: QTCREATORBUG-26631 Change-Id: Ia1854ba2a4d34afff1d2c80aac4c9919cd3142dc Reviewed-by: Erik Verbruggen Reviewed-by: Qt CI Bot Reviewed-by: Alessandro Portale --- src/plugins/mcusupport/mcusupportoptions.cpp | 32 +++++++++++++++----- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/plugins/mcusupport/mcusupportoptions.cpp b/src/plugins/mcusupport/mcusupportoptions.cpp index 4a21ece87bc..4c9c7dab27d 100644 --- a/src/plugins/mcusupport/mcusupportoptions.cpp +++ b/src/plugins/mcusupport/mcusupportoptions.cpp @@ -497,8 +497,27 @@ QVariant McuToolChainPackage::debuggerId() const { using namespace Debugger; - QString sub = QString::fromLatin1(m_type == TypeArmGcc ? "bin/arm-none-eabi-gdb-py" - : m_type == TypeIAR ? "../common/bin/CSpyBat" : "bar/foo-keil-gdb"); + QString sub, displayName; + DebuggerEngineType engineType; + + switch (m_type) { + case TypeArmGcc: { + sub = QString::fromLatin1("bin/arm-none-eabi-gdb-py"); + displayName = McuPackage::tr("Arm GDB at %1"); + engineType = Debugger::GdbEngineType; + break; } + case TypeIAR: { + sub = QString::fromLatin1("../common/bin/CSpyBat"); + displayName = QLatin1String("CSpy"); + engineType = Debugger::NoEngineType; // support for IAR missing + break; } + case TypeKEIL: { + sub = QString::fromLatin1("UV4/UV4"); + displayName = QLatin1String("KEIL uVision Debugger"); + engineType = Debugger::UvscEngineType; + break; } + default: return QVariant(); + } const FilePath command = path().pathAppended(sub).withExecutableSuffix(); const DebuggerItem *debugger = DebuggerItemManager::findByCommand(command); @@ -506,11 +525,8 @@ QVariant McuToolChainPackage::debuggerId() const if (!debugger) { DebuggerItem newDebugger; newDebugger.setCommand(command); - const QString displayName = m_type == TypeArmGcc - ? McuPackage::tr("Arm GDB at %1") - : m_type == TypeIAR ? QLatin1String("CSpy") - : QLatin1String("/bar/foo-keil-gdb"); newDebugger.setUnexpandedDisplayName(displayName.arg(command.toUserOutput())); + newDebugger.setEngineType(engineType); debuggerId = DebuggerItemManager::registerDebugger(newDebugger); } else { debuggerId = debugger->id(); @@ -743,7 +759,9 @@ static void setKitDebugger(Kit *k, const McuToolChainPackage *tcPackage) || tcPackage->type() == McuToolChainPackage::TypeIAR) return; - Debugger::DebuggerKitAspect::setDebugger(k, tcPackage->debuggerId()); + const QVariant debuggerId = tcPackage->debuggerId(); + if (debuggerId.isValid()) + Debugger::DebuggerKitAspect::setDebugger(k, debuggerId); } static void setKitDevice(Kit *k, const McuTarget* mcuTarget) From 8fd937f29f394b16e99dbb3f3421489b5b5d3dde Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 1 Dec 2021 13:04:45 +0100 Subject: [PATCH 05/10] StudioWelcome: Fix missing include Amends 536f96fef8b927. Change-Id: I1e143fc42fe6e085798d39da11292b9f9faf81f0 Reviewed-by: Samuel Ghinet Reviewed-by: David Schulz --- src/plugins/studiowelcome/qdsnewdialog.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/studiowelcome/qdsnewdialog.cpp b/src/plugins/studiowelcome/qdsnewdialog.cpp index 6492bb85791..1ab2a45ee8b 100644 --- a/src/plugins/studiowelcome/qdsnewdialog.cpp +++ b/src/plugins/studiowelcome/qdsnewdialog.cpp @@ -23,9 +23,6 @@ ** ****************************************************************************/ -#include -#include - #include "qdsnewdialog.h" #include @@ -37,6 +34,10 @@ #include "wizardfactories.h" #include "newprojectdialogimageprovider.h" +#include +#include +#include + using namespace StudioWelcome; namespace { From 06e1182574b4bb1c3adedcf0c7e9d532391f5f8a Mon Sep 17 00:00:00 2001 From: Mats Honkamaa Date: Tue, 30 Nov 2021 15:27:06 +0200 Subject: [PATCH 06/10] Doc: Split the Examples and Tutorials Section into two pages Splitting Examples and Tutorials to own separate pages. Task-number: QDS-5495 Change-Id: I0014f1ab456298e9b5887b511f608725ec9d2455 Reviewed-by: Leena Miettinen Reviewed-by: Mahmoud Badri --- .../src/user-interface/creator-ui.qdoc | 2 +- doc/qtdesignstudio/examples/doc/loginui1.qdoc | 1 - doc/qtdesignstudio/examples/doc/loginui2.qdoc | 1 - doc/qtdesignstudio/examples/doc/loginui3.qdoc | 1 - doc/qtdesignstudio/examples/doc/loginui4.qdoc | 3 +- .../src/overviews/qtquick-uis.qdoc | 2 +- .../src/qtdesignstudio-examples.qdoc | 48 +++++++------------ .../src/qtdesignstudio-faq.qdoc | 2 +- .../src/qtdesignstudio-getting-started.qdoc | 8 ++-- .../src/qtdesignstudio-installation.qdoc | 6 +-- .../src/qtdesignstudio-terms.qdoc | 2 +- .../src/qtdesignstudio-toc.qdoc | 4 +- .../src/qtdesignstudio-tutorials.qdoc | 24 ++++++---- doc/qtdesignstudio/src/qtdesignstudio.qdoc | 4 +- 14 files changed, 49 insertions(+), 59 deletions(-) diff --git a/doc/qtcreator/src/user-interface/creator-ui.qdoc b/doc/qtcreator/src/user-interface/creator-ui.qdoc index 2af504a69d8..2d154021cf6 100644 --- a/doc/qtcreator/src/user-interface/creator-ui.qdoc +++ b/doc/qtcreator/src/user-interface/creator-ui.qdoc @@ -32,7 +32,7 @@ /*! \page creator-quick-tour.html \if defined(qtdesignstudio) - \previouspage {Your First UI} + \previouspage {Tutorials} \else \previouspage creator-overview.html \endif diff --git a/doc/qtdesignstudio/examples/doc/loginui1.qdoc b/doc/qtdesignstudio/examples/doc/loginui1.qdoc index 0165817ad63..31e1ebb549d 100644 --- a/doc/qtdesignstudio/examples/doc/loginui1.qdoc +++ b/doc/qtdesignstudio/examples/doc/loginui1.qdoc @@ -25,7 +25,6 @@ /*! \example loginui1 - \ingroup studioexamples \ingroup gstutorials \nextpage {Log In UI - Positioning} diff --git a/doc/qtdesignstudio/examples/doc/loginui2.qdoc b/doc/qtdesignstudio/examples/doc/loginui2.qdoc index 0a74a67f850..6ff8b2f5422 100644 --- a/doc/qtdesignstudio/examples/doc/loginui2.qdoc +++ b/doc/qtdesignstudio/examples/doc/loginui2.qdoc @@ -25,7 +25,6 @@ /*! \example loginui2 - \ingroup studioexamples \ingroup gstutorials \previouspage {Log In UI - Components} \nextpage {Log In UI - States} diff --git a/doc/qtdesignstudio/examples/doc/loginui3.qdoc b/doc/qtdesignstudio/examples/doc/loginui3.qdoc index a7a919319cf..d04690b224f 100644 --- a/doc/qtdesignstudio/examples/doc/loginui3.qdoc +++ b/doc/qtdesignstudio/examples/doc/loginui3.qdoc @@ -25,7 +25,6 @@ /*! \example loginui3 - \ingroup studioexamples \ingroup gstutorials \title Log In UI - States diff --git a/doc/qtdesignstudio/examples/doc/loginui4.qdoc b/doc/qtdesignstudio/examples/doc/loginui4.qdoc index b88c122558c..5c8bdca033b 100644 --- a/doc/qtdesignstudio/examples/doc/loginui4.qdoc +++ b/doc/qtdesignstudio/examples/doc/loginui4.qdoc @@ -25,7 +25,6 @@ /*! \example loginui4 - \ingroup studioexamples \ingroup gstutorials \title Log In UI - Timeline @@ -324,5 +323,5 @@ \section1 Next Steps - For more examples about using timelines, see \l{Examples and Tutorials}. + For more examples about using timelines, see \l{Examples}. */ diff --git a/doc/qtdesignstudio/src/overviews/qtquick-uis.qdoc b/doc/qtdesignstudio/src/overviews/qtquick-uis.qdoc index 3cb66337fc4..4b626c46e0d 100644 --- a/doc/qtdesignstudio/src/overviews/qtquick-uis.qdoc +++ b/doc/qtdesignstudio/src/overviews/qtquick-uis.qdoc @@ -26,7 +26,7 @@ /*! \page quick-uis.html \if defined(qtdesignstudio) - \previouspage {Examples and Tutorials} + \previouspage {Examples} \nextpage studio-app-flows.html \else \previouspage qtquick-text-editor.html diff --git a/doc/qtdesignstudio/src/qtdesignstudio-examples.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-examples.qdoc index d2b7a7e9dd9..f80f66dc38d 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-examples.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-examples.qdoc @@ -27,43 +27,29 @@ \previouspage studio-terms.html \group studioexamples \nextpage quick-uis.html - \title Examples and Tutorials + \title Examples - In the \uicontrol Welcome mode, you can open examples and tutorials that - illustrate how to use \QDS. Some examples are delivered together with - \QDS and have been documented, while you can download and install others - for previewing them on the desktop. - - \section1 Video Tutorials - - The \uicontrol Tutorials tab contains links to video tutorials that provide - more information about \QDS. To watch a tutorial on YouTube, select it in - the tab. - - \include qtbridge-tutorial-links.qdocinc qtsketchbridge tutorials - - \section1 Examples for Downloading - - The \uicontrol Examples tab lists complex example applications for - downloading that demonstrate what you can accomplish with \QDS. + \QDS comes with a set of example projects. To see these, select \uicontrol + Examples on the \uicontrol Welcome page when you run \QDS. \image studio-examples-download.png "Examples for download in Welcome mode" - To download the examples and open them in \QDS: - + To run an example project: \list 1 - \li Select an example. - \li Select \uicontrol {Start Download} to download the example source - files. - \li Select the folder where the source files will be installed. - \li Select \uicontrol Continue to install the files. - \li Select \uicontrol Open to open the example in \QDS. - \li Select the \inlineimage live_preview.png - (\uicontrol {Show Live Preview}) button to preview the example. + \li Select the example. + \li Select the \inlineimage live_preview.png + (\uicontrol {Show Live Preview}) button to preview the example. \endlist - \section1 Documented Examples + Some of the example projects require that you download them before you can run them, to do this: + \list 1 + \li Select an example. + \li Select \uicontrol {Start Download}. + \li Select the folder where the source files will be installed. + \li Select \uicontrol Continue to install the files. + \li Select \uicontrol Open to open the example in \QDS. + \endlist + + \section1 Example Documentation - The \uicontrol Examples tab lists documented examples of using \QDS. To - open an example in \QDS, select it in the tab. */ diff --git a/doc/qtdesignstudio/src/qtdesignstudio-faq.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-faq.qdoc index 0e802ebcc7f..97981f16bcd 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-faq.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-faq.qdoc @@ -34,7 +34,7 @@ grouped by categories. You might also find answers to your questions in the product documentation by searching or browsing the index in the \l{Using the Help Mode}{Help mode}. Many questions are also answered by the - \l{Examples and Tutorials}{examples and video tutorials}. + \l{Examples}{examples} and \l{Tutorials}{video tutorials}. \list \li \l {FAQ - \QB}{\QB} diff --git a/doc/qtdesignstudio/src/qtdesignstudio-getting-started.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-getting-started.qdoc index 58dbd20203c..6ad323da3e7 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-getting-started.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-getting-started.qdoc @@ -47,10 +47,10 @@ \QDS is available either as a standalone installation package or as an option in the Qt online installer. - \li \l {Your First UI} + \li \l {Tutorials} - Follow a set of hands-on tutorials that build on each other to - design your first animated UI using preset and custom components. + Follow a set of hands-on tutorials that illustrate how to use the + features of \QDS. \li \l {User Interface} Describes the parts and basic features of \QDS. @@ -71,7 +71,7 @@ \li \l{Concepts and Terms} Describes main \QDS concepts and terms. - \li \l{Examples and Tutorials} + \li \l{Examples} A set of examples available in the \uicontrol Welcome mode illustrates how to use \QDS features such as the timeline. diff --git a/doc/qtdesignstudio/src/qtdesignstudio-installation.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-installation.qdoc index 701b84d30c5..a896a1ded60 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-installation.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-installation.qdoc @@ -26,7 +26,7 @@ /*! \page studio-installation.html \previouspage studio-getting-started.html - \nextpage {Your First UI} + \nextpage {Tutorials} \title Installation @@ -42,8 +42,8 @@ package \l{https://www.qt.io/product/ui-design-tools}{here}. After the installation, you can start exploring \QDS by following - tutorials to \l{Your First UI}{create your first UI}, opening - \l{Examples and Tutorials}{examples}, watching videos, and reading + \l{Tutorials}{tutorials}, opening + \l{Examples}{examples}, watching videos, and reading this manual. \section1 Stand-Alone Installation diff --git a/doc/qtdesignstudio/src/qtdesignstudio-terms.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-terms.qdoc index a1b163bc213..c05618ee0ca 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-terms.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-terms.qdoc @@ -26,7 +26,7 @@ /*! \page studio-terms.html \previouspage studio-use-cases.html - \nextpage {Examples and Tutorials} + \nextpage {Examples} \title Concepts and Terms diff --git a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc index 52ba3915318..cd6982b1007 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-toc.qdoc @@ -31,7 +31,7 @@ \li \l{Getting Started} \list \li \l{Installation} - \li \l{Your First UI} + \li \l{Tutorials} \li \l{User Interface} \list \li \l{Selecting Modes} @@ -59,7 +59,7 @@ \li \l{Creating Projects} \li \l{Use Cases} \li \l{Concepts and Terms} - \li \l{Examples and Tutorials} + \li \l{Examples} \endlist \li \l{Wireframing} \list diff --git a/doc/qtdesignstudio/src/qtdesignstudio-tutorials.qdoc b/doc/qtdesignstudio/src/qtdesignstudio-tutorials.qdoc index 331e84185a5..0ff5137f58a 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio-tutorials.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio-tutorials.qdoc @@ -28,14 +28,22 @@ \previouspage studio-installation.html \nextpage creator-quick-tour.html - \title Your First UI + \title Tutorials \image loginui4.gif "Log In UI" - You can follow a set of hands-on tutorials that build on each other to + \section1 Video Tutorials + + When you run \QDS, the \uicontrol Tutorials tab in \uicontrol Welcome mode contains links + to video tutorials. To watch a tutorial on YouTube, + select it. + + \section1 Written Tutorials + + You can follow a set of hands-on tutorials that illustrate how to use the features of \QDS. Even if you plan to export your - designs from a design tool, it is useful to first create a small UI from - scratch to learn to use \QDS. In particular, \e {Log In UI - Components} + designs from a design tool, it is useful to go through tutorials to learn to + use \QDS. In particular, \l {Log In UI - Components} describes the terms and concepts that you will run into when exporting designs with \QB. @@ -43,8 +51,8 @@ yourself with the parts of \QDS in general, and the \uicontrol Design mode in particular: \l{User Interface} and \l{Design Views}. - In addition to these entry-level tutorials, \QDS comes with examples - and video tutorials that you can open from the \uicontrol Examples and - \uicontrol Tutorials tabs in the \uicontrol Welcome mode. For more - information, see \l {Examples and Tutorials}. + In addition to these tutorials, \QDS comes with examples that you can open + from the \uicontrol Examples and tabs in the \uicontrol Welcome mode. For more + information, see \l {Examples}. + */ diff --git a/doc/qtdesignstudio/src/qtdesignstudio.qdoc b/doc/qtdesignstudio/src/qtdesignstudio.qdoc index e97a0cbf6a3..a64c5e95bed 100644 --- a/doc/qtdesignstudio/src/qtdesignstudio.qdoc +++ b/doc/qtdesignstudio/src/qtdesignstudio.qdoc @@ -48,12 +48,12 @@ \li \b {\l{Getting Started}} \list \li \l{Installation} - \li \l{Your First UI} + \li \l{Tutorials} \li \l{User Interface} \li \l{Creating Projects} \li \l{Use Cases} \li \l{Concepts and Terms} - \li \l{Examples and Tutorials} + \li \l{Examples} \endlist \li \b {\l{Wireframing}} \list From 38b2bb9fb2fbc0d764605c9a103ff58ea26c2d61 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 1 Dec 2021 14:54:44 +0100 Subject: [PATCH 07/10] TextEditor: Fix crash in hover handler Amends 2dbe5c72d8e9b. Change-Id: If4343f606af1bdf25409ffaef82e44456fee7ee4 Reviewed-by: David Schulz --- src/plugins/texteditor/texteditor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index ef6e1698134..28fe278cabd 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -342,6 +342,7 @@ public: void checkNext() { + QTC_ASSERT(m_currentHandlerIndex >= 0, return); QTC_ASSERT(m_currentHandlerIndex < m_handlers.size(), return); BaseHoverHandler *currentHandler = m_handlers[m_currentHandlerIndex]; @@ -352,6 +353,7 @@ public: void onHandlerFinished(int documentRevision, int position, int priority) { + QTC_ASSERT(m_currentHandlerIndex >= 0, return); QTC_ASSERT(m_currentHandlerIndex < m_handlers.size(), return); QTC_ASSERT(documentRevision == m_documentRevision, return); QTC_ASSERT(position == m_position, return); From beb167a963b1d9161c26769aa08be4670206249e Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 1 Dec 2021 13:46:58 +0100 Subject: [PATCH 08/10] Add qt's toolchain file to initial cmake arguments for Windows on ARM64 Fixes: QTCREATORBUG-26636 Change-Id: Id9fc9f3c2242136d2fa4d42e7e64b038a50b1809 Reviewed-by: Cristian Adam --- .../cmakeprojectmanager/cmakebuildconfiguration.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index f43decd9406..6f74bc9126e 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -805,6 +805,13 @@ static bool isDocker(const Kit *k) return DeviceTypeKitAspect::deviceTypeId(k) == Docker::Constants::DOCKER_DEVICE_TYPE; } +static bool isWindowsARM64(const Kit *k) +{ + const auto targetAbi = ToolChainKitAspect::cxxToolChain(k)->targetAbi(); + return targetAbi.os() == Abi::WindowsOS && targetAbi.architecture() == Abi::ArmArchitecture + && targetAbi.wordWidth() == 64; +} + static QStringList defaultInitialCMakeArguments(const Kit *k, const QString buildType) { // Generator: @@ -991,7 +998,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id) initialArgs.append("%{" + QLatin1String(CMAKE_OSX_ARCHITECTURES_FLAG) + "}"); } - if (isWebAssembly(k) || isQnx(k)) { + if (isWebAssembly(k) || isQnx(k) || isWindowsARM64(k)) { const QtSupport::BaseQtVersion *qt = QtSupport::QtKitAspect::qtVersion(k); if (qt && qt->qtVersion().majorVersion >= 6) initialArgs.append(CMAKE_QT6_TOOLCHAIN_FILE_ARG); From eadc9cb0e3f7c007c79e01dd96e4bd0a56066f3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20M=C3=A4=C3=A4tt=C3=A4?= Date: Mon, 22 Nov 2021 13:32:14 +0200 Subject: [PATCH 09/10] Improve particle system animation driver - Do not automatically restart particle system animation when pressing the restart button if the animation is paused. - Use own QElapsedTimer in AnimationDriver and properly handle animation driver pausing. Change-Id: Ic2924fb66fddffb8878625be8fa766f06219ca61 Reviewed-by: Miikka Heikkinen Reviewed-by: Qt CI Bot Reviewed-by: Thomas Hartmann --- .../qml2puppet/instances/animationdriver.cpp | 13 ++++----- .../qml2puppet/instances/animationdriver.h | 27 ++++++++++++++++--- .../qt5informationnodeinstanceserver.cpp | 14 +++++----- .../components/edit3d/edit3dview.cpp | 8 +----- 4 files changed, 39 insertions(+), 23 deletions(-) diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/animationdriver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/animationdriver.cpp index 4f32513b7ec..d8ef223104d 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/animationdriver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/animationdriver.cpp @@ -31,8 +31,6 @@ AnimationDriver::AnimationDriver(QObject *parent) { setProperty("allowNegativeDelta", true); install(); - connect(this, SIGNAL(started()), this, SLOT(startTimer())); - connect(this, SIGNAL(stopped()), this, SLOT(stopTimer())); } AnimationDriver::~AnimationDriver() @@ -49,10 +47,13 @@ void AnimationDriver::timerEvent(QTimerEvent *e) // Provide same time for all users if (m_seekerEnabled) { m_seekerElapsed += (m_seekerPos * 100) / 30; - if (m_seekerElapsed + m_elapsed < -100) // -100 to allow small negative value - m_seekerElapsed = -m_elapsed - 100; + if (m_seekerElapsed + m_elapsed - m_pauseTime < -100) // -100 to allow small negative value + m_seekerElapsed = -(m_elapsed - m_pauseTime) - 100; } else { - m_elapsed = QAnimationDriver::elapsed(); + if (!m_elapsedTimer.isValid()) + m_elapsedTimer.restart(); + else + m_elapsed = m_elapsedTimer.elapsed(); } m_delta = elapsed() - old; advance(); @@ -75,7 +76,7 @@ void AnimationDriver::setSeekerPosition(int position) return; if (!m_timer.isActive()) - restart(); + startTimer(); m_seekerPos = position; } diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/animationdriver.h b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/animationdriver.h index f4f50f0afcd..e8e84d7dfde 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/animationdriver.h +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/animationdriver.h @@ -27,6 +27,7 @@ #include #include +#include #include class AnimationDriver : public QAnimationDriver @@ -46,17 +47,34 @@ public: } void reset() { - stop(); + m_elapsedTimer.invalidate(); + m_pauseBegin = 0; + m_pauseTime = 0; + m_elapsed = 0; + m_seekerElapsed = 0; stopTimer(); } void restart() { - start(); + m_pauseTime = 0; + m_elapsed = 0; + m_seekerElapsed = 0; + startTimer(); + } + void pause() + { + m_pauseBegin = m_elapsedTimer.elapsed(); + stopTimer(); + } + void play() + { + if (m_elapsedTimer.isValid()) + m_pauseTime += m_elapsedTimer.elapsed() - m_pauseBegin; startTimer(); } qint64 elapsed() const override { - return m_elapsed + m_seekerElapsed; + return m_elapsed + m_seekerElapsed - m_pauseTime; } void setSeekerPosition(int position); void setSeekerEnabled(bool enable) @@ -79,10 +97,13 @@ private: Q_SLOT void stopTimer(); QBasicTimer m_timer; + QElapsedTimer m_elapsedTimer; int m_interval = 16; int m_seekerPos = 0; bool m_seekerEnabled = false; qint64 m_elapsed = 0; qint64 m_seekerElapsed = 0; qint64 m_delta = 0; + qint64 m_pauseTime = 0; + qint64 m_pauseBegin = 0; }; diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index afc4adcae04..16dc3dbe5fd 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -2078,21 +2078,21 @@ void Qt5InformationNodeInstanceServer::view3DAction(const View3DActionCommand &c m_particleAnimationPlaying = command.isEnabled(); updatedState.insert("particlePlay", command.isEnabled()); if (m_particleAnimationPlaying) { - m_particleAnimationDriver->reset(); - m_particleAnimationDriver->restart(); + m_particleAnimationDriver->play(); m_particleAnimationDriver->setSeekerEnabled(false); m_particleAnimationDriver->setSeekerPosition(0); } else { - m_particleAnimationDriver->reset(); + m_particleAnimationDriver->pause(); m_particleAnimationDriver->setSeekerEnabled(true); } break; case View3DActionCommand::ParticlesRestart: resetParticleSystem(); - m_particleAnimationPlaying = true; - m_particleAnimationDriver->restart(); - m_particleAnimationDriver->setSeekerEnabled(false); - m_particleAnimationDriver->setSeekerPosition(0); + if (m_particleAnimationPlaying) { + m_particleAnimationDriver->restart(); + m_particleAnimationDriver->setSeekerEnabled(false); + m_particleAnimationDriver->setSeekerPosition(0); + } break; case View3DActionCommand::ParticlesSeek: m_particleAnimationDriver->setSeekerPosition(static_cast(command).position()); diff --git a/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp b/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp index 1c944f49a94..ba5ac595fbd 100644 --- a/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp +++ b/src/plugins/qmldesigner/components/edit3d/edit3dview.cpp @@ -305,12 +305,6 @@ void Edit3DView::createEdit3DActions() resetPuppet(); }; - SelectionContextOperation particlesRestartTrigger = [this](const SelectionContext &) { - m_particlesPlayAction->action()->setChecked(true); - if (m_seeker) - m_seeker->setEnabled(false); - }; - SelectionContextOperation particlesPlayTrigger = [this](const SelectionContext &) { if (m_seeker) m_seeker->setEnabled(!m_particlesPlayAction->action()->isChecked()); @@ -334,7 +328,7 @@ void Edit3DView::createEdit3DActions() QmlDesigner::Constants::EDIT3D_PARTICLES_RESTART, View3DActionCommand::ParticlesRestart, QCoreApplication::translate("ParticlesRestartAction", "Restart Particles"), QKeySequence(Qt::Key_E), false, false, Icons::EDIT3D_PARTICLE_RESTART.icon(), - Icons::EDIT3D_PARTICLE_RESTART.icon(), particlesRestartTrigger); + Icons::EDIT3D_PARTICLE_RESTART.icon()); m_particlesPlayAction->action()->setEnabled(particlemode); m_particlesRestartAction->action()->setEnabled(particlemode); m_resetAction From 26ba5bdb0cbe69c2b51f2e00dd70f56932feffb3 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 30 Nov 2021 14:57:18 +0200 Subject: [PATCH 10/10] QmlDesigner: Fix puppet crash with nested Repeater3Ds Repeater3D instance instantiated by another Repeater3D got its componentCompleted called twice because a repeater constructing a child repeater already completes the component as part of the process, and then we recursively complete the children again when completing the parent. Added a check to avoid duplicate completions. Fixes: QDS-5651 Change-Id: Iefc7deff4877df903f784396f2efd13468f604b7 Reviewed-by: Samuel Ghinet Reviewed-by: Qt CI Bot Reviewed-by: Thomas Hartmann --- .../qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp index 195fd805f47..03b28bbf658 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp +++ b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp @@ -61,6 +61,10 @@ #include #include +#ifdef QUICK3D_MODULE +#include +#endif + namespace QmlDesigner { namespace Internal { @@ -374,6 +378,11 @@ void doComponentCompleteRecursive(QObject *object, NodeInstanceServer *nodeInsta if (item && DesignerSupport::isComponentComplete(item)) return; +#ifdef QUICK3D_MODULE + auto obj3d = qobject_cast(object); + if (obj3d && QQuick3DObjectPrivate::get(obj3d)->componentComplete) + return; +#endif if (!nodeInstanceServer->hasInstanceForObject(item)) emitComponentComplete(object);