summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qmlpropertycache.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/declarative/qml/qmlpropertycache.cpp b/src/declarative/qml/qmlpropertycache.cpp
index 300bbf6..63ce00c 100644
--- a/src/declarative/qml/qmlpropertycache.cpp
+++ b/src/declarative/qml/qmlpropertycache.cpp
@@ -111,14 +111,10 @@ QmlPropertyCache::Data QmlPropertyCache::create(const QMetaObject *metaObject,
QmlPropertyCache::Data rv;
- int propCount = metaObject->propertyCount();
- for (int ii = propCount - 1; ii >= 0; --ii) {
- QMetaProperty p = metaObject->property(ii);
- QString propName = QLatin1String(p.name());
- if (propName == property) {
- rv.load(p);
- return rv;
- }
+ int idx = metaObject->indexOfProperty(property.toUtf8());
+ if (idx != -1) {
+ rv.load(metaObject->property(idx));
+ return rv;
}
int methodCount = metaObject->methodCount();