From 14800c1c0f31966b367fffd94f411d61c8b24776 Mon Sep 17 00:00:00 2001 From: Aleksei German Date: Thu, 13 Jun 2024 17:48:10 +0200 Subject: [PATCH] QmlDesigner: Enable Layouts in MCUs config Task-number: QDS-11663 Change-Id: I8d5ffb9d44696e7d286561e295ecaeb0d96ca6a7 Reviewed-by: Aleksei German (cherry picked from commit ceb5950573f8b857ff75031a724ecf13a5a0071a) Reviewed-by: Thomas Hartmann --- .../QtQuick/Layouts/ColumnLayoutSpecifics.qml | 5 +++- .../QtQuick/Layouts/GridLayoutSpecifics.qml | 5 ++++ .../QtQuick/Layouts/RowLayoutSpecifics.qml | 6 ++++- share/qtcreator/qmldesigner/qt4mcu/qul-28.qml | 27 +++++++++++++++++++ .../application-mcu/app_mcu.qmlproject.tpl | 3 ++- 5 files changed, 43 insertions(+), 3 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/ColumnLayoutSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/ColumnLayoutSpecifics.qml index aeaeacbd4ec..86a6c9079f2 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/ColumnLayoutSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/ColumnLayoutSpecifics.qml @@ -7,6 +7,7 @@ import HelperWidgets 2.0 import StudioTheme 1.0 as StudioTheme Section { + id: root anchors.left: parent.left anchors.right: parent.right caption: qsTr("Column Layout") @@ -50,9 +51,10 @@ Section { } PropertyLabel { - text: qsTr("Uniform cell size") + text: qsTr("Uniform cell sizes") tooltip: qsTr("Toggles all cells to have a uniform size.") visible: majorQtQuickVersion === 6 && minorQtQuickVersion >= 6 + blockedByTemplate: !backendValues.uniformCellSizes.isAvailable } SecondColumnLayout { @@ -61,6 +63,7 @@ Section { + StudioTheme.Values.actionIndicatorWidth backendValue: backendValues.uniformCellSizes visible: majorQtQuickVersion === 6 && minorQtQuickVersion >= 6 + enabled: backendValues.uniformCellSizes.isAvailable } ExpandingSpacer {} diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/GridLayoutSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/GridLayoutSpecifics.qml index e6606ffe00f..f5e76108c1b 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/GridLayoutSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/GridLayoutSpecifics.qml @@ -7,6 +7,7 @@ import HelperWidgets 2.0 import StudioTheme 1.0 as StudioTheme Section { + id: root anchors.left: parent.left anchors.right: parent.right caption: qsTr("Grid Layout") @@ -131,6 +132,8 @@ Section { text: qsTr("Uniform cell sizes") tooltip: qsTr("Toggles all cells to have a uniform height or width.") visible: majorQtQuickVersion === 6 && minorQtQuickVersion >= 6 + blockedByTemplate: !(backendValues.uniformCellHeights.isAvailable + && backendValues.uniformCellWidths.isAvailable) } SecondColumnLayout { @@ -140,6 +143,7 @@ Section { + StudioTheme.Values.actionIndicatorWidth backendValue: backendValues.uniformCellHeights visible: majorQtQuickVersion === 6 && minorQtQuickVersion >= 6 + enabled: backendValues.uniformCellHeights.isAvailable } Spacer { implicitWidth: StudioTheme.Values.twoControlColumnGap } @@ -150,6 +154,7 @@ Section { + StudioTheme.Values.actionIndicatorWidth backendValue: backendValues.uniformCellWidths visible: majorQtQuickVersion === 6 && minorQtQuickVersion >= 6 + enabled: backendValues.uniformCellWidths.isAvailable } ExpandingSpacer {} diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/RowLayoutSpecifics.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/RowLayoutSpecifics.qml index 726b3783fbc..6f7431ad037 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/RowLayoutSpecifics.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/Layouts/RowLayoutSpecifics.qml @@ -7,6 +7,7 @@ import HelperWidgets 2.0 import StudioTheme 1.0 as StudioTheme Section { + id: root anchors.left: parent.left anchors.right: parent.right caption: qsTr("Row Layout") @@ -50,16 +51,19 @@ Section { } PropertyLabel { - text: qsTr("Uniform cell size") + text: qsTr("Uniform cell sizes") tooltip: qsTr("Toggles all cells to have a uniform size.") visible: majorQtQuickVersion === 6 && minorQtQuickVersion >= 6 + blockedByTemplate: !backendValues.uniformCellSizes.isAvailable } + SecondColumnLayout { CheckBox { implicitWidth: StudioTheme.Values.twoControlColumnWidth + StudioTheme.Values.actionIndicatorWidth backendValue: backendValues.uniformCellSizes visible: majorQtQuickVersion === 6 && minorQtQuickVersion >= 6 + enabled: backendValues.uniformCellSizes.isAvailable } ExpandingSpacer {} diff --git a/share/qtcreator/qmldesigner/qt4mcu/qul-28.qml b/share/qtcreator/qmldesigner/qt4mcu/qul-28.qml index 00e79dce53a..281f4f08263 100644 --- a/share/qtcreator/qmldesigner/qt4mcu/qul-28.qml +++ b/share/qtcreator/qmldesigner/qt4mcu/qul-28.qml @@ -45,6 +45,8 @@ VersionData { "QtQuick.Controls.ToolButton", "QtQuick.Controls.ToolSeparator", "QtQuick.Controls.Tumbler", + "QtQuick.Layouts.LayoutItemProxy", + "QtQuick.Layouts.StackLayout", "QtQuick.Shapes.ConicalGradient", "QtQuick.Shapes.RadialGradient" ] @@ -52,6 +54,7 @@ VersionData { allowedImports: [ "QtQuick", "QtQuick.Controls", + "QtQuick.Layouts", "QtQuick.Shapes", "QtQuick.Timeline", "QtQuickUltralite.Extras", @@ -185,6 +188,30 @@ VersionData { bannedProperties: ["live", "snapMode", "touchDragThreshold"] } + ComplexProperty { + prefix: "Layout" + bannedProperties: ["horizontalStretchFactor", "verticalStretchFactor"] + } + + QtQuick.Layouts.Layout { + bannedProperties: ["horizontalStretchFactor", "verticalStretchFactor"] + } + + QtQuick.Layouts.ColumnLayout { + allowedProperties: ["layoutDirection"] + bannedProperties: ["uniformCellSizes"] + } + + QtQuick.Layouts.RowLayout { + allowedProperties: ["layoutDirection"] + bannedProperties: ["uniformCellSizes"] + } + + QtQuick.Layouts.GridLayout { + allowedProperties: ["layoutDirection"] + bannedProperties: ["uniformCellHeights", "uniformCellWidths"] + } + //Path and Shapes related: QtQuick.Path { diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/application-mcu/app_mcu.qmlproject.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/application-mcu/app_mcu.qmlproject.tpl index f8a2e18d7d0..6ea0b215fad 100644 --- a/share/qtcreator/qmldesigner/studio_templates/projects/application-mcu/app_mcu.qmlproject.tpl +++ b/share/qtcreator/qmldesigner/studio_templates/projects/application-mcu/app_mcu.qmlproject.tpl @@ -56,7 +56,8 @@ Project { "Timeline", "Shapes", "Profiling", - "StudioComponents" + "StudioComponents", + "Layouts" ] }