From: Roberto Raggi Date: Thu, 18 Aug 2011 14:36:10 +0000 (+0200) Subject: Fix property lookup in QDeclarativePropertyCache::create. X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=b92695e0fe541e9b67bd55378a6d784990d11424;p=konrad%2Fqtdeclarative.git Fix property lookup in QDeclarativePropertyCache::create. Search for the property in the current meta object. Change-Id: I085f4285298ae952d9c50ee93c47b4009dbe900f Reviewed-on: http://codereview.qt.nokia.com/3792 Reviewed-by: Roberto Raggi Reviewed-by: Qt Sanity Bot --- diff --git a/src/declarative/qml/qdeclarativepropertycache.cpp b/src/declarative/qml/qdeclarativepropertycache.cpp index 6ccb5c6..406e43f 100644 --- a/src/declarative/qml/qdeclarativepropertycache.cpp +++ b/src/declarative/qml/qdeclarativepropertycache.cpp @@ -241,12 +241,13 @@ QDeclarativePropertyCache::Data QDeclarativePropertyCache::create(const QMetaObj QDeclarativePropertyCache::Data rv; { const QMetaObject *cmo = metaObject; + const QByteArray propertyName = property.toUtf8(); while (cmo) { - int idx = metaObject->indexOfProperty(property.toUtf8()); + int idx = cmo->indexOfProperty(propertyName); if (idx != -1) { - QMetaProperty p = metaObject->property(idx); + QMetaProperty p = cmo->property(idx); if (p.isScriptable()) { - rv.load(metaObject->property(idx)); + rv.load(p); return rv; } else { while (cmo && cmo->propertyOffset() >= idx)