aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2019-09-05 15:38:26 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2019-09-05 15:03:17 +0000
commit9ca9a7e4a6c46ca83c3ed1eb878b620398e15770 (patch)
tree65c7f93c9d0b567ff6de6b1590c5c6ce383fe0fb
parent898bdf12c09dd189de4bb9ec3a87aff2863718fa (diff)
QmlDesigner: Add missing functionality to QtObjectPane
It should be also possible to change types for non items. Change-Id: Ia44a8b4fda97c5fb25e513c6b3c3eed15abb1c1d Reviewed-by: Henning Gründl <henning.gruendl@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/QtObjectPane.qml50
1 files changed, 47 insertions, 3 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/QtObjectPane.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/QtObjectPane.qml
index bf02e53803..2136b9c9dc 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/QtObjectPane.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/QtObjectPane.qml
@@ -53,10 +53,54 @@ Rectangle {
}
SecondColumnLayout {
+ z: 2
- Label {
- text: backendValues.className.value
- width: lineEdit.width
+ RoundedPanel {
+ Layout.fillWidth: true
+ height: 24
+
+ Label {
+ x: 6
+ anchors.fill: parent
+ anchors.leftMargin: 16
+
+ text: backendValues.className.value
+ verticalAlignment: Text.AlignVCenter
+ }
+ ToolTipArea {
+ anchors.fill: parent
+ onDoubleClicked: {
+ typeLineEdit.text = backendValues.className.value
+ typeLineEdit.visible = ! typeLineEdit.visible
+ typeLineEdit.forceActiveFocus()
+ }
+ tooltip: qsTr("Change the type of this item.")
+ enabled: !modelNodeBackend.multiSelection
+ }
+
+ ExpressionTextField {
+ z: 2
+ id: typeLineEdit
+ completeOnlyTypes: true
+
+ anchors.fill: parent
+
+ visible: false
+
+ showButtons: false
+ fixedSize: true
+
+ onEditingFinished: {
+ if (visible)
+ changeTypeName(typeLineEdit.text.trim())
+ visible = false
+ }
+ }
+
+ }
+ Item {
+ Layout.preferredWidth: 16
+ Layout.preferredHeight: 16
}
}