aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativepropertycache.cpp
diff options
context:
space:
mode:
authorRoberto Raggi <roberto.raggi@nokia.com>2011-08-18 16:36:10 +0200
committerQt by Nokia <qt-info@nokia.com>2011-08-30 13:18:28 +0200
commitb92695e0fe541e9b67bd55378a6d784990d11424 (patch)
tree2ce701044e81933ed843f526cc0267a3f4cc2db5 /src/declarative/qml/qdeclarativepropertycache.cpp
parentdbf89bcec8631cd9af472a5e9d7c386f4726a9f0 (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.cpp7
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)