From 600ed1ebcc6834561a22791d2bc2abceda8f6821 Mon Sep 17 00:00:00 2001
From: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Date: Wed, 21 Apr 2010 14:49:17 +0200
Subject: [PATCH] QmlDesigner.propertyEditor allow setting of expressions in
 states

---
 .../components/propertyeditor/propertyeditor.cpp          | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
index cd23ccf1bc5..c7db49f44d8 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
@@ -155,6 +155,8 @@ void PropertyEditor::NodeType::setValue(const QmlObjectNode & fxObjectNode, cons
         propertyValue->setValue(value);
         if (!fxObjectNode.hasBindingProperty(name))
             propertyValue->setExpression(value.toString());
+        else
+            propertyValue->setExpression(fxObjectNode.expression(name));
     }
 }
 
@@ -469,10 +471,8 @@ void PropertyEditor::changeExpression(const QString &name)
     }
 
     try {
-        if (fxObjectNode.currentState().isBaseState()) {
-            if (fxObjectNode.modelNode().bindingProperty(name).expression() != value->expression())
-                fxObjectNode.modelNode().bindingProperty(name).setExpression(value->expression());
-        }
+        if (fxObjectNode.expression(name) != value->expression() || !fxObjectNode.propertyAffectedByCurrentState(name))
+            fxObjectNode.setBindingProperty(name, value->expression());
     }
 
     catch (RewritingException &e) {
-- 
GitLab