summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Gruendl <henning.gruendl@qt.io>2023-04-20 18:47:08 +0200
committerHenning Gründl <henning.gruendl@qt.io>2023-04-21 14:51:56 +0000
commit7af8c225d11ac2dcfcebdecdc91f01b944c580c0 (patch)
tree10000585f937cd48e74fa3ecba92d83f7ab1770d
parent0c7c7272ea11fe4e4b55c9f98774cfc19d5764df (diff)
downloadqt-creator-7af8c225d11ac2dcfcebdecdc91f01b944c580c0.tar.gz
QmlDesigner: Expose objectName for Qt Insight
- Expose objectName in Property Editor - Rearrange Annotation button in Component Section - Fix enabled state of insight view - Add reset of Property Editor when enabled state is toggled Task-number: QDS-9355 Change-Id: I873994580d8135f97236b6a98462c513169ac8c1 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentSection.qml47
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/InsightSection.qml21
-rw-r--r--src/plugins/insight/insightmodel.cpp6
3 files changed, 50 insertions, 24 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentSection.qml
index 839c656d8a..49809cb9d9 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentSection.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComponentSection.qml
@@ -174,7 +174,29 @@ Section {
}
PropertyLabel {
- text: qsTr("Name")
+ visible: root.showState
+ text: qsTr("State")
+ tooltip: qsTr("Sets the state of the component.")
+ }
+
+ 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 {}
+ }
+
+ PropertyLabel {
+ text: annotationEditor.hasAuxData ? qsTr("Annotation") : ""
tooltip: qsTr("Adds a note with a title to explain the component.")
}
@@ -226,6 +248,7 @@ Section {
visible: !annotationEditor.hasAuxData
buttonIcon: qsTr("Add Annotation")
iconFont: StudioTheme.Constants.font
+ tooltip: qsTr("Adds a note with a title to explain the component.")
onClicked: annotationEditor.showWidget()
onHoveredChanged: annotationEditor.checkAux()
}
@@ -252,27 +275,5 @@ Section {
onCanceled: hideWidget()
}
}
-
- PropertyLabel {
- visible: root.showState
- text: qsTr("State")
- tooltip: qsTr("Sets the state of the component.")
- }
-
- 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 {}
- }
}
}
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/InsightSection.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/InsightSection.qml
index 5a4c6f48a8..b23f8ff95d 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/InsightSection.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/InsightSection.qml
@@ -8,7 +8,7 @@ import StudioTheme 1.0 as StudioTheme
Section {
id: root
- caption: qsTr("Analytics")
+ caption: qsTr("Insight")
anchors.left: parent.left
anchors.right: parent.right
@@ -84,5 +84,24 @@ Section {
ExpandingSpacer {}
}
+
+ PropertyLabel {
+ text: qsTr("Object name")
+ tooltip: qsTr("Sets the object name of the component.")
+ }
+
+ SecondColumnLayout {
+ LineEdit {
+ implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ + StudioTheme.Values.actionIndicatorWidth
+ width: StudioTheme.Values.singleControlColumnWidth
+ backendValue: backendValues.objectName
+ text: backendValues.objectName.value
+ showTranslateCheckBox: false
+ enabled: !modelNodeBackend.multiSelection
+ }
+
+ ExpandingSpacer {}
+ }
}
}
diff --git a/src/plugins/insight/insightmodel.cpp b/src/plugins/insight/insightmodel.cpp
index 64cb8f90a1..4fe987a597 100644
--- a/src/plugins/insight/insightmodel.cpp
+++ b/src/plugins/insight/insightmodel.cpp
@@ -9,6 +9,7 @@
#include <plaintexteditmodifier.h>
#include <rewriterview.h>
#include <signalhandlerproperty.h>
+#include <qmldesignerplugin.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projecttree.h>
@@ -452,6 +453,11 @@ void InsightModel::setEnabled(bool value)
if (!m_qtdsConfigInfo.exists())
writeJSON(m_qtdsConfigInfo.absoluteFilePath(), m_qtdsConfig);
}
+
+ m_enabled = value;
+ setAuxiliaryEnabled(m_enabled);
+
+ QmlDesignerPlugin::instance()->viewManager().resetPropertyEditorView();
}
QString InsightModel::token() const