aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2017-11-13 16:58:18 +0100
committerThomas Hartmann <thomas.hartmann@qt.io>2017-11-14 14:54:26 +0000
commit6b5192bd529dca15ffd4b13f28f32592c60cefc2 (patch)
tree2832ead4b3af567c3f46e8eb357f8ac76906cd19 /src
parent056c9c641f7d66cef670dba8a8dbd72e93cdb6ee (diff)
QmlDesigner: Update state names if edited in text
Task-number: QTCREATORBUG-19283 Change-Id: Ic627c609d784e570d47bcea2fdddf8ab9240ef92 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp13
-rw-r--r--src/plugins/qmldesigner/components/stateseditor/stateseditorview.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
index 76613a3790..8347e28510 100644
--- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
+++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
@@ -389,6 +389,19 @@ void StatesEditorView::bindingPropertiesChanged(const QList<BindingProperty> &pr
}
}
+void StatesEditorView::variantPropertiesChanged(const QList<VariantProperty> &propertyList,
+ AbstractView::PropertyChangeFlags /*propertyChange*/)
+{
+ m_block = true;
+
+ for (const VariantProperty &property : propertyList) {
+ if (property.name() == "name" && QmlModelState::isValidQmlModelState(property.parentModelNode()))
+ resetModel();
+ }
+
+ m_block = false;
+}
+
void StatesEditorView::currentStateChanged(const ModelNode &node)
{
QmlModelState newQmlModelState(node);
diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h
index 8038f0cd88..15debd7931 100644
--- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h
+++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.h
@@ -69,6 +69,7 @@ public:
AbstractView::PropertyChangeFlags propertyChange) override;
void nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &movedNode, int oldIndex) override;
void bindingPropertiesChanged(const QList<BindingProperty>& propertyList, PropertyChangeFlags propertyChange) override;
+ void variantPropertiesChanged(const QList<VariantProperty>& propertyList, PropertyChangeFlags propertyChange) override;
// AbstractView