summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlmetaproperty.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-10-12 03:58:42 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-10-12 03:58:42 (GMT)
commit1ea93870fce7ff032053775fb19d42e950dd5ccb (patch)
treeccdf099207d295b062a1abde307da3b5057e771a /src/declarative/qml/qmlmetaproperty.cpp
parent55e4d0591a2b18e08519144a416d1fea9a625cd8 (diff)
downloadQt-1ea93870fce7ff032053775fb19d42e950dd5ccb.zip
Qt-1ea93870fce7ff032053775fb19d42e950dd5ccb.tar.gz
Qt-1ea93870fce7ff032053775fb19d42e950dd5ccb.tar.bz2
Composite types should assign to object properties
Fixes QT-956
Diffstat (limited to 'src/declarative/qml/qmlmetaproperty.cpp')
-rw-r--r--src/declarative/qml/qmlmetaproperty.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp
index ce4836e..34c98bf 100644
--- a/src/declarative/qml/qmlmetaproperty.cpp
+++ b/src/declarative/qml/qmlmetaproperty.cpp
@@ -874,7 +874,7 @@ void QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
const QMetaObject *propMo = QmlMetaType::rawMetaObjectForType(t);
while (valMo) {
- if (valMo == propMo)
+ if (equal(valMo, propMo))
break;
valMo = valMo->superClass();
}
@@ -928,7 +928,7 @@ void QmlMetaPropertyPrivate::write(QObject *object, const QmlPropertyCache::Data
const QMetaObject *objMo = obj->metaObject();
bool found = false;
while(!found && objMo) {
- if (objMo == mo)
+ if (equal(objMo, mo))
found = true;
else
objMo = objMo->superClass();
@@ -1211,4 +1211,13 @@ QmlMetaProperty QmlMetaProperty::createProperty(QObject *obj,
return prop;
}
+/*!
+ Returns true if lhs and rhs refer to the same metaobject data
+*/
+bool QmlMetaPropertyPrivate::equal(const QMetaObject *lhs, const QMetaObject *rhs)
+{
+ return lhs == rhs || (1 && lhs && rhs && lhs->d.stringdata == rhs->d.stringdata);
+}
+
+
QT_END_NAMESPACE