summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2016-12-15 16:53:58 +0100
committerThomas Hartmann <thomas.hartmann@qt.io>2016-12-21 11:45:04 +0000
commit87ac4cfafeaa03aa39a379d4947a069726e9154d (patch)
treee603534af8d9e8447c884a0865f8054ad91f83b4 /share
parent75f867b9bf6829c2ec58d7ac381563c61774d859 (diff)
downloadqt-creator-87ac4cfafeaa03aa39a379d4947a069726e9154d.tar.gz
QmlDesigner: Implementing gui for changing type
This implements the gui to change the type of an item. Double click the type name in the property editor to change the type. Change-Id: I071ad203394691cc6b44f4336d483c473366fc72 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/qmldir1
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml47
2 files changed, 45 insertions, 3 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/qmldir b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/qmldir
index 10f92a578a..40241fe958 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/qmldir
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/qmldir
@@ -39,3 +39,4 @@ TabView 2.0 TabView.qml
ToolTipArea 2.0 ToolTipArea.qml
UrlChooser 2.0 UrlChooser.qml
PaddingSection 2.0 PaddingSection.qml
+RoundedPanel 2.0 RoundedPanel.qml
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml
index 073364685b..92d2b8b10d 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/ItemPane.qml
@@ -53,9 +53,50 @@ Rectangle {
SecondColumnLayout {
- 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.visible = ! typeLineEdit.visible
+ typeLineEdit.forceActiveFocus()
+ }
+ tooltip: qsTr("Change the type of this item.")
+ }
+
+ LineEdit {
+ id: typeLineEdit
+
+ anchors.fill: parent
+
+ visible: false
+
+ backendValue: className.id
+
+ text: backendValues.className.value
+
+ showTranslateCheckBox: false
+ showExtendedFunctionButton: false
+ onEditingFinished: {
+ visible = false
+ changeTypeName(typeLineEdit.text)
+ }
+ }
+
+ }
+ Item {
+ Layout.preferredWidth: 16
+ Layout.preferredHeight: 16
}
}