diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2011-08-18 16:36:10 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-08-30 13:18:28 +0200 |
commit | b92695e0fe541e9b67bd55378a6d784990d11424 (patch) | |
tree | 2ce701044e81933ed843f526cc0267a3f4cc2db5 /src/declarative/qml/qdeclarativepropertycache.cpp | |
parent | dbf89bcec8631cd9af472a5e9d7c386f4726a9f0 (diff) |
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 <roberto.raggi@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'src/declarative/qml/qdeclarativepropertycache.cpp')
-rw-r--r-- | src/declarative/qml/qdeclarativepropertycache.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/declarative/qml/qdeclarativepropertycache.cpp b/src/declarative/qml/qdeclarativepropertycache.cpp index 6ccb5c678f..406e43fc21 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) |