aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Gruendl <henning.gruendl@qt.io>2021-10-21 13:10:24 +0200
committerHenning Gründl <henning.gruendl@qt.io>2021-10-26 17:54:54 +0000
commit73fb9d7002512f5a71cfe17e2db0a9f2553608c9 (patch)
tree2e4cc3d08cb3150cc9f4b1751bbed019fcdcfffe
parent92cb2427f8d8e5cd3c1b662070715b4e5110f0b5 (diff)
QmlDesigner: Expose state property for 3DObjects
Task-number: QDS-5225 Change-Id: I08b5839ef70dd3e3ea9ebd615646494e3667a479 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml20
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick3D/Object3DPane.qml4
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentSection.qml24
3 files changed, 30 insertions, 18 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml
index 98b41da305..a55280a040 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml
@@ -33,7 +33,9 @@ import StudioTheme 1.0 as StudioTheme
PropertyEditorPane {
id: itemPane
- ComponentSection {}
+ ComponentSection {
+ showState: true
+ }
GeometrySection {}
@@ -82,22 +84,6 @@ PropertyEditorPane {
ExpandingSpacer {}
}
-
- PropertyLabel { text: qsTr("State") }
-
- SecondColumnLayout {
- ComboBox {
- implicitWidth: StudioTheme.Values.singleControlColumnWidth
- + StudioTheme.Values.actionIndicatorWidth
- width: implicitWidth
- editable: true
- backendValue: backendValues.state
- model: allStateNames
- valueType: ComboBox.String
- }
-
- ExpandingSpacer {}
- }
}
}
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick3D/Object3DPane.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick3D/Object3DPane.qml
index c6cd287b99..7cded878a1 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick3D/Object3DPane.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick3D/Object3DPane.qml
@@ -32,7 +32,9 @@ import StudioTheme 1.0 as StudioTheme
PropertyEditorPane {
id: itemPane
- ComponentSection {}
+ ComponentSection {
+ showState: majorVersion >= 6
+ }
Column {
anchors.left: parent.left
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentSection.qml
index f285c6a620..7a2225bee7 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentSection.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentSection.qml
@@ -32,11 +32,14 @@ import HelperWidgets 2.0
import StudioTheme 1.0 as StudioTheme
Section {
+ id: root
caption: qsTr("Component")
anchors.left: parent.left
anchors.right: parent.right
+ property bool showState: false
+
SectionLayout {
PropertyLabel { text: qsTr("Type") }
@@ -262,5 +265,26 @@ Section {
onCanceled: hideWidget()
}
}
+
+ PropertyLabel {
+ visible: root.showState
+ text: qsTr("State")
+ }
+
+ SecondColumnLayout {
+ visible: root.showState
+
+ ComboBox {
+ implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ + StudioTheme.Values.actionIndicatorWidth
+ width: implicitWidth
+ editable: true
+ backendValue: backendValues.state
+ model: allStateNames
+ valueType: ComboBox.String
+ }
+
+ ExpandingSpacer {}
+ }
}
}