Commit f4983380 authored by Kai Koehne's avatar Kai Koehne

Fix compilation against latest qt-dui

d914555badc in qt-dui/master removed QmlType::fromObject. This
patch replaces the method with QVariant::fromValue. The difference
here is that the QVariant type is always QObject*, instead of
the real inherited type. We have yet to verify if this breaks something.
parent 978c89f5
......@@ -83,7 +83,7 @@ void createPropertyEditorValue(const QmlObjectNode &fxObjectNode, const QString
valueObject = new PropertyEditorValue(propertyMap);
QObject::connect(valueObject, SIGNAL(valueChanged(QString)), propertyMap, SIGNAL(valueChanged(QString)));
QObject::connect(valueObject, SIGNAL(expressionChanged(QString)), propertyEditor, SLOT(changeExpression(QString)));
propertyMap->insert(propertyName, QmlMetaType::qmlType(valueObject->metaObject())->fromObject(valueObject));
propertyMap->insert(propertyName, QVariant::fromValue(valueObject));
}
valueObject->setName(propertyName);
valueObject->setModelNode(fxObjectNode);
......@@ -129,14 +129,14 @@ void PropertyEditor::NodeType::setup(const QmlObjectNode &fxObjectNode, const QS
valueObject->setModelNode(fxObjectNode.modelNode());
valueObject->setValue(fxObjectNode.modelNode().simplifiedTypeName());
QObject::connect(valueObject, SIGNAL(valueChanged(QString)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString)));
m_backendValuesPropertyMap.insert("className", QmlMetaType::qmlType(valueObject->metaObject())->fromObject(valueObject));
m_backendValuesPropertyMap.insert("className", QVariant::fromValue(valueObject));
// id
valueObject = new PropertyEditorValue(&m_backendValuesPropertyMap);
valueObject->setName("id");
valueObject->setValue(fxObjectNode.id());
QObject::connect(valueObject, SIGNAL(valueChanged(QString)), &m_backendValuesPropertyMap, SIGNAL(valueChanged(QString)));
m_backendValuesPropertyMap.insert("id", QmlMetaType::qmlType(valueObject->metaObject())->fromObject(valueObject));
m_backendValuesPropertyMap.insert("id", QVariant::fromValue(valueObject));
// anchors
m_backendAnchorBinding.setup(QmlItemNode(fxObjectNode.modelNode()));
......
......@@ -306,7 +306,7 @@ void PropertyEditorNodeWrapper::setup()
valueObject->setValue(fxObjectNode.instanceValue(propertyName));
connect(valueObject, SIGNAL(valueChanged(QString)), &m_valuesPropertyMap, SIGNAL(valueChanged(QString)));
m_valuesPropertyMap.insert(propertyName, QmlMetaType::qmlType(valueObject->metaObject())->fromObject(valueObject));
m_valuesPropertyMap.insert(propertyName, QVariant::fromValue(valueObject));
}
}
connect(&m_valuesPropertyMap, SIGNAL(valueChanged(const QString &)), this, SLOT(changeValue(const QString&)));
......
......@@ -301,10 +301,7 @@ static bool isObject(const QmlMetaProperty &metaProperty)
static QVariant objectToVariant(QObject *object)
{
const QMetaObject *metaObject = object->metaObject();
QmlType *qmlType = QmlMetaType::qmlType(metaObject);
return qmlType->fromObject(object);
return QVariant::fromValue(object);
}
static void removeObjectFromList(const QmlMetaProperty &metaProperty, QObject *object, QmlEngine *engine)
......
Markdown is supported
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