From 2001622cc4beeddd2ccf85aa5aaa0b8e57e158bc Mon Sep 17 00:00:00 2001
From: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Date: Wed, 31 Mar 2010 18:41:44 +0200
Subject: [PATCH] QmlDesigner.propertyEditor: adapt to qml changes

QDeclarativePropertyMap changed

void valueChanged(const QString &key, const QVariant &value);
==>
void valueChanged(const QString &key);
---
 .../components/propertyeditor/propertyeditor.cpp   | 14 +++++++-------
 .../components/propertyeditor/propertyeditor.h     |  2 +-
 .../propertyeditor/propertyeditorvalue.cpp         | 10 +++++-----
 .../propertyeditor/propertyeditorvalue.h           |  2 +-
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
index bdd7761e7f1..ada6f374a71 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
@@ -89,7 +89,7 @@ PropertyEditor::NodeType::NodeType(PropertyEditor *propertyEditor) :
     m_dummyPropertyEditorValue->setValue("#000000");
     ctxt->setContextProperty("dummyBackendValue", m_dummyPropertyEditorValue.data());
 
-    connect(&m_backendValuesPropertyMap, SIGNAL(valueChanged(const QString&)), propertyEditor, SLOT(changeValue(const QString&)));
+    connect(&m_backendValuesPropertyMap, SIGNAL(valueChanged(const QString&, const QVariant&)), propertyEditor, SLOT(changeValue(const QString&)));
 }
 
 PropertyEditor::NodeType::~NodeType()
@@ -103,7 +103,7 @@ void setupPropertyEditorValue(const QString &name, QDeclarativePropertyMap *prop
     PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(QDeclarativeMetaType::toQObject(propertyMap->value(propertyName)));
     if (!valueObject) {
         valueObject = new PropertyEditorValue(propertyMap);
-        QObject::connect(valueObject, SIGNAL(valueChanged(QString)), propertyMap, SIGNAL(valueChanged(QString)));
+        QObject::connect(valueObject, SIGNAL(valueChanged(QString, const QVariant&)), propertyMap, SIGNAL(valueChanged(QString, const QVariant&)));
         QObject::connect(valueObject, SIGNAL(expressionChanged(QString)), propertyEditor, SLOT(changeExpression(QString)));
         propertyMap->insert(propertyName, QVariant::fromValue(valueObject));
     }
@@ -122,7 +122,7 @@ void createPropertyEditorValue(const QmlObjectNode &fxObjectNode, const QString
     PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(QDeclarativeMetaType::toQObject(propertyMap->value(propertyName)));
     if (!valueObject) {
         valueObject = new PropertyEditorValue(propertyMap);
-        QObject::connect(valueObject, SIGNAL(valueChanged(QString)), propertyMap, SIGNAL(valueChanged(QString)));
+        QObject::connect(valueObject, SIGNAL(valueChanged(QString, const QVariant&)), propertyMap, SIGNAL(valueChanged(QString, const QVariant&)));
         QObject::connect(valueObject, SIGNAL(expressionChanged(QString)), propertyEditor, SLOT(changeExpression(QString)));
         propertyMap->insert(propertyName, QVariant::fromValue(valueObject));
     }
@@ -175,7 +175,7 @@ void PropertyEditor::NodeType::setup(const QmlObjectNode &fxObjectNode, const QS
         valueObject->setName("className");
         valueObject->setModelNode(fxObjectNode.modelNode());
         valueObject->setValue(fxObjectNode.modelNode().simplifiedTypeName());
-        QObject::connect(valueObject, SIGNAL(valueChanged(QString)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString)));
+        QObject::connect(valueObject, SIGNAL(valueChanged(QString, const QVariant&)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString, const QVariant&)));
         m_backendValuesPropertyMap.insert("className", QVariant::fromValue(valueObject));
 
         // id
@@ -184,7 +184,7 @@ void PropertyEditor::NodeType::setup(const QmlObjectNode &fxObjectNode, const QS
             valueObject = new PropertyEditorValue(&m_backendValuesPropertyMap);
         valueObject->setName("id");
         valueObject->setValue(fxObjectNode.id());
-        QObject::connect(valueObject, SIGNAL(valueChanged(QString)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString)));
+        QObject::connect(valueObject, SIGNAL(valueChanged(QString, const QVariant&)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString, const QVariant&)));
         m_backendValuesPropertyMap.insert("id", QVariant::fromValue(valueObject));
 
         // anchors
@@ -225,7 +225,7 @@ void PropertyEditor::NodeType::initialSetup(const QString &typeName, const QUrl
     valueObject->setName("className");
 
     valueObject->setValue(typeName);
-    QObject::connect(valueObject, SIGNAL(valueChanged(QString)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString)));
+    QObject::connect(valueObject, SIGNAL(valueChanged(QString, const QVariant&)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString, const QVariant&)));
     m_backendValuesPropertyMap.insert("className", QVariant::fromValue(valueObject));
 
     // id
@@ -234,7 +234,7 @@ void PropertyEditor::NodeType::initialSetup(const QString &typeName, const QUrl
         valueObject = new PropertyEditorValue(&m_backendValuesPropertyMap);
     valueObject->setName("id");
     valueObject->setValue("id");
-    QObject::connect(valueObject, SIGNAL(valueChanged(QString)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString)));
+    QObject::connect(valueObject, SIGNAL(valueChanged(QString, const QVariant&)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString, const QVariant&)));
     m_backendValuesPropertyMap.insert("id", QVariant::fromValue(valueObject));
 
     ctxt->setContextProperty("anchorBackend", &m_backendAnchorBinding);
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h
index b0b8c8781e0..a0760f0acd4 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.h
@@ -118,7 +118,7 @@ private slots:
 private: //functions
     QString qmlFileName(const NodeMetaInfo &nodeInfo) const;
     QUrl fileToUrl(const QString &filePath) const;
-    QUrl qmlForNode(const ModelNode &modelNode) const;
+    QUrl qmlForNode(const ModelNode &modelNode, QString &className) const;
     QString locateQmlFile(const QString &relativePath) const;
     void select(const ModelNode& node);
 
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp
index 70aeb2ec95d..268cd78e722 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.cpp
@@ -86,7 +86,7 @@ void PropertyEditorValue::setValueWithEmit(const QVariant &value)
             return;
         setValue(newValue);
         m_isBound = false;
-        emit valueChanged(name());
+        emit valueChanged(name(), value);
         emit isBoundChanged();
     }
 }
@@ -95,7 +95,7 @@ void PropertyEditorValue::setValue(const QVariant &value)
 {
     if ( m_value != value) {
         m_value = value;
-        emit valueChanged(QString());
+        emit valueChanged(QString(), value);
     }
     emit isBoundChanged();
 }
@@ -183,7 +183,7 @@ void PropertyEditorValue::resetValue()
     if (m_value.isValid()) {
         setValue(QVariant());
         m_isBound = false;
-        emit valueChanged(name());
+        emit valueChanged(name(), QVariant());
     }
 }
 
@@ -308,11 +308,11 @@ void PropertyEditorNodeWrapper::setup()
             valueObject->setName(propertyName);
             valueObject->setValue(fxObjectNode.instanceValue(propertyName));
 
-            connect(valueObject, SIGNAL(valueChanged(QString)), &m_valuesPropertyMap, SIGNAL(valueChanged(QString)));
+            connect(valueObject, SIGNAL(valueChanged(QString, const QVariant&)), &m_valuesPropertyMap, SIGNAL(valueChanged(QString, const QVariant&)));
             m_valuesPropertyMap.insert(propertyName, QVariant::fromValue(valueObject));
         }
     }
-    connect(&m_valuesPropertyMap, SIGNAL(valueChanged(const QString &)), this, SLOT(changeValue(const QString&)));
+    connect(&m_valuesPropertyMap, SIGNAL(valueChanged(const QString &, const QVariant&)), this, SLOT(changeValue(const QString&)));
 
     emit propertiesChanged();
     emit existsChanged();
diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h
index a9c9e282498..9a81e17f25e 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorvalue.h
@@ -123,7 +123,7 @@ public slots:
     void resetValue();
 
 signals:
-    void valueChanged(const QString &name);
+    void valueChanged(const QString &name, const QVariant&);
 
     void expressionChanged(const QString &name);
 
-- 
GitLab