forked from qt-creator/qt-creator
QmlDesigner.propertyEditor: adapt to qml changes
QDeclarativePropertyMap changed void valueChanged(const QString &key, const QVariant &value); ==> void valueChanged(const QString &key);
This commit is contained in:
@@ -89,7 +89,7 @@ PropertyEditor::NodeType::NodeType(PropertyEditor *propertyEditor) :
|
|||||||
m_dummyPropertyEditorValue->setValue("#000000");
|
m_dummyPropertyEditorValue->setValue("#000000");
|
||||||
ctxt->setContextProperty("dummyBackendValue", m_dummyPropertyEditorValue.data());
|
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()
|
PropertyEditor::NodeType::~NodeType()
|
||||||
@@ -103,7 +103,7 @@ void setupPropertyEditorValue(const QString &name, QDeclarativePropertyMap *prop
|
|||||||
PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(QDeclarativeMetaType::toQObject(propertyMap->value(propertyName)));
|
PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(QDeclarativeMetaType::toQObject(propertyMap->value(propertyName)));
|
||||||
if (!valueObject) {
|
if (!valueObject) {
|
||||||
valueObject = new PropertyEditorValue(propertyMap);
|
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)));
|
QObject::connect(valueObject, SIGNAL(expressionChanged(QString)), propertyEditor, SLOT(changeExpression(QString)));
|
||||||
propertyMap->insert(propertyName, QVariant::fromValue(valueObject));
|
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)));
|
PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(QDeclarativeMetaType::toQObject(propertyMap->value(propertyName)));
|
||||||
if (!valueObject) {
|
if (!valueObject) {
|
||||||
valueObject = new PropertyEditorValue(propertyMap);
|
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)));
|
QObject::connect(valueObject, SIGNAL(expressionChanged(QString)), propertyEditor, SLOT(changeExpression(QString)));
|
||||||
propertyMap->insert(propertyName, QVariant::fromValue(valueObject));
|
propertyMap->insert(propertyName, QVariant::fromValue(valueObject));
|
||||||
}
|
}
|
||||||
@@ -175,7 +175,7 @@ void PropertyEditor::NodeType::setup(const QmlObjectNode &fxObjectNode, const QS
|
|||||||
valueObject->setName("className");
|
valueObject->setName("className");
|
||||||
valueObject->setModelNode(fxObjectNode.modelNode());
|
valueObject->setModelNode(fxObjectNode.modelNode());
|
||||||
valueObject->setValue(fxObjectNode.modelNode().simplifiedTypeName());
|
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));
|
m_backendValuesPropertyMap.insert("className", QVariant::fromValue(valueObject));
|
||||||
|
|
||||||
// id
|
// id
|
||||||
@@ -184,7 +184,7 @@ void PropertyEditor::NodeType::setup(const QmlObjectNode &fxObjectNode, const QS
|
|||||||
valueObject = new PropertyEditorValue(&m_backendValuesPropertyMap);
|
valueObject = new PropertyEditorValue(&m_backendValuesPropertyMap);
|
||||||
valueObject->setName("id");
|
valueObject->setName("id");
|
||||||
valueObject->setValue(fxObjectNode.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));
|
m_backendValuesPropertyMap.insert("id", QVariant::fromValue(valueObject));
|
||||||
|
|
||||||
// anchors
|
// anchors
|
||||||
@@ -225,7 +225,7 @@ void PropertyEditor::NodeType::initialSetup(const QString &typeName, const QUrl
|
|||||||
valueObject->setName("className");
|
valueObject->setName("className");
|
||||||
|
|
||||||
valueObject->setValue(typeName);
|
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));
|
m_backendValuesPropertyMap.insert("className", QVariant::fromValue(valueObject));
|
||||||
|
|
||||||
// id
|
// id
|
||||||
@@ -234,7 +234,7 @@ void PropertyEditor::NodeType::initialSetup(const QString &typeName, const QUrl
|
|||||||
valueObject = new PropertyEditorValue(&m_backendValuesPropertyMap);
|
valueObject = new PropertyEditorValue(&m_backendValuesPropertyMap);
|
||||||
valueObject->setName("id");
|
valueObject->setName("id");
|
||||||
valueObject->setValue("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));
|
m_backendValuesPropertyMap.insert("id", QVariant::fromValue(valueObject));
|
||||||
|
|
||||||
ctxt->setContextProperty("anchorBackend", &m_backendAnchorBinding);
|
ctxt->setContextProperty("anchorBackend", &m_backendAnchorBinding);
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ private slots:
|
|||||||
private: //functions
|
private: //functions
|
||||||
QString qmlFileName(const NodeMetaInfo &nodeInfo) const;
|
QString qmlFileName(const NodeMetaInfo &nodeInfo) const;
|
||||||
QUrl fileToUrl(const QString &filePath) 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;
|
QString locateQmlFile(const QString &relativePath) const;
|
||||||
void select(const ModelNode& node);
|
void select(const ModelNode& node);
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ void PropertyEditorValue::setValueWithEmit(const QVariant &value)
|
|||||||
return;
|
return;
|
||||||
setValue(newValue);
|
setValue(newValue);
|
||||||
m_isBound = false;
|
m_isBound = false;
|
||||||
emit valueChanged(name());
|
emit valueChanged(name(), value);
|
||||||
emit isBoundChanged();
|
emit isBoundChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ void PropertyEditorValue::setValue(const QVariant &value)
|
|||||||
{
|
{
|
||||||
if ( m_value != value) {
|
if ( m_value != value) {
|
||||||
m_value = value;
|
m_value = value;
|
||||||
emit valueChanged(QString());
|
emit valueChanged(QString(), value);
|
||||||
}
|
}
|
||||||
emit isBoundChanged();
|
emit isBoundChanged();
|
||||||
}
|
}
|
||||||
@@ -183,7 +183,7 @@ void PropertyEditorValue::resetValue()
|
|||||||
if (m_value.isValid()) {
|
if (m_value.isValid()) {
|
||||||
setValue(QVariant());
|
setValue(QVariant());
|
||||||
m_isBound = false;
|
m_isBound = false;
|
||||||
emit valueChanged(name());
|
emit valueChanged(name(), QVariant());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,11 +308,11 @@ void PropertyEditorNodeWrapper::setup()
|
|||||||
valueObject->setName(propertyName);
|
valueObject->setName(propertyName);
|
||||||
valueObject->setValue(fxObjectNode.instanceValue(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));
|
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 propertiesChanged();
|
||||||
emit existsChanged();
|
emit existsChanged();
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ public slots:
|
|||||||
void resetValue();
|
void resetValue();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void valueChanged(const QString &name);
|
void valueChanged(const QString &name, const QVariant&);
|
||||||
|
|
||||||
void expressionChanged(const QString &name);
|
void expressionChanged(const QString &name);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user