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>
This commit is contained in:
Thomas Hartmann
2019-09-05 15:38:26 +02:00
parent 898bdf12c0
commit 9ca9a7e4a6

View File

@@ -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
}
}