From 9ca9a7e4a6c46ca83c3ed1eb878b620398e15770 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 5 Sep 2019 15:38:26 +0200 Subject: [PATCH] QmlDesigner: Add missing functionality to QtObjectPane MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It should be also possible to change types for non items. Change-Id: Ia44a8b4fda97c5fb25e513c6b3c3eed15abb1c1d Reviewed-by: Henning Gründl Reviewed-by: Thomas Hartmann --- .../QtQuick/QtObjectPane.qml | 50 +++++++++++++++++-- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/QtObjectPane.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/QtObjectPane.qml index bf02e538032..2136b9c9dc5 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 } }