summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-03-03 07:53:05 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-03-03 07:53:05 (GMT)
commitef785f047adf6f559c282d67e627b78b75a7b9ef (patch)
tree4a2ce58063692d853e03de6f0a8d8fc31ec12dc2 /src/declarative
parent4690084e9f3fbf3635aa3fb6a8025ae046672aea (diff)
downloadQt-ef785f047adf6f559c282d67e627b78b75a7b9ef.zip
Qt-ef785f047adf6f559c282d67e627b78b75a7b9ef.tar.gz
Qt-ef785f047adf6f559c282d67e627b78b75a7b9ef.tar.bz2
QDeclarativeProperty::read() returns a QObjectStar when accessing a QObject property
QT-2793
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qdeclarativeproperty.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp
index e1ec2cd..521c241 100644
--- a/src/declarative/qml/qdeclarativeproperty.cpp
+++ b/src/declarative/qml/qdeclarativeproperty.cpp
@@ -793,7 +793,7 @@ QVariant QDeclarativeProperty::read(QObject *object, const QString &name, QDecla
QVariant QDeclarativePropertyPrivate::readValueProperty()
{
- if(isValueType()) {
+ if (isValueType()) {
QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context);
QDeclarativeValueType *valueType = 0;
@@ -809,13 +809,20 @@ QVariant QDeclarativePropertyPrivate::readValueProperty()
if (!ep) delete valueType;
return rv;
- } else if(core.flags & QDeclarativePropertyCache::Data::IsQList) {
+ } else if (core.flags & QDeclarativePropertyCache::Data::IsQList) {
QDeclarativeListProperty<QObject> prop;
void *args[] = { &prop, 0 };
QMetaObject::metacall(object, QMetaObject::ReadProperty, core.coreIndex, args);
return QVariant::fromValue(QDeclarativeListReferencePrivate::init(prop, core.propType, engine));
+ } else if (core.flags & QDeclarativePropertyCache::Data::IsQObjectDerived) {
+
+ QObject *rv = 0;
+ void *args[] = { &rv, 0 };
+ QMetaObject::metacall(object, QMetaObject::ReadProperty, core.coreIndex, args);
+ return QVariant::fromValue(rv);
+
} else {
return object->metaObject()->property(core.coreIndex).read(object.data());