Commit 2001622c authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: adapt to qml changes

QDeclarativePropertyMap changed

void valueChanged(const QString &key, const QVariant &value);
==>
void valueChanged(const QString &key);
parent 205f1c76
......@@ -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);
......
......@@ -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);
......
......@@ -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();
......
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment