summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-10-18 03:24:28 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-10-18 03:29:42 (GMT)
commit0c06e59577df1ec715e67d6d5842800bcec24945 (patch)
tree61f2b9a7030c68dcfd8663afa08df0bd8f420cc0
parentda74568ede8faf587b2f312874632a537cb712c0 (diff)
downloadQt-0c06e59577df1ec715e67d6d5842800bcec24945.zip
Qt-0c06e59577df1ec715e67d6d5842800bcec24945.tar.gz
Qt-0c06e59577df1ec715e67d6d5842800bcec24945.tar.bz2
Properties should have precedence over methods.
Fixes regression introduced by recent changes to the property cache. Task-Number: QTBUG-14500 Reviewed-by: Aaron Kennedy
-rw-r--r--src/declarative/qml/qdeclarativepropertycache.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/declarative/qml/qdeclarativepropertycache.cpp b/src/declarative/qml/qdeclarativepropertycache.cpp
index 91aaaa4..0adcdbd 100644
--- a/src/declarative/qml/qdeclarativepropertycache.cpp
+++ b/src/declarative/qml/qdeclarativepropertycache.cpp
@@ -236,35 +236,6 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb
{
QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
- int propCount = metaObject->propertyCount();
- int propOffset = metaObject->propertyOffset();
-
- indexCache.resize(propCount);
- for (int ii = propOffset; ii < propCount; ++ii) {
- QMetaProperty p = metaObject->property(ii);
- if (!p.isScriptable())
- continue;
-
- QString propName = QString::fromUtf8(p.name());
-
- RData *data = new RData;
- data->identifier = enginePriv->objectClass->createPersistentIdentifier(propName);
- indexCache[ii] = data;
-
- data->load(p, engine);
- data->flags |= propertyFlags;
-
- if (stringCache.contains(propName)) {
- stringCache[propName]->release();
- identifierCache[data->identifier.identifier]->release();
- }
-
- stringCache.insert(propName, data);
- identifierCache.insert(data->identifier.identifier, data);
- data->addref();
- data->addref();
- }
-
int methodCount = metaObject->methodCount();
// 3 to block the destroyed signal and the deleteLater() slot
int methodOffset = qMax(3, metaObject->methodOffset());
@@ -304,6 +275,35 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb
data->addref();
data->addref();
}
+
+ int propCount = metaObject->propertyCount();
+ int propOffset = metaObject->propertyOffset();
+
+ indexCache.resize(propCount);
+ for (int ii = propOffset; ii < propCount; ++ii) {
+ QMetaProperty p = metaObject->property(ii);
+ if (!p.isScriptable())
+ continue;
+
+ QString propName = QString::fromUtf8(p.name());
+
+ RData *data = new RData;
+ data->identifier = enginePriv->objectClass->createPersistentIdentifier(propName);
+ indexCache[ii] = data;
+
+ data->load(p, engine);
+ data->flags |= propertyFlags;
+
+ if (stringCache.contains(propName)) {
+ stringCache[propName]->release();
+ identifierCache[data->identifier.identifier]->release();
+ }
+
+ stringCache.insert(propName, data);
+ identifierCache.insert(data->identifier.identifier, data);
+ data->addref();
+ data->addref();
+ }
}
void QDeclarativePropertyCache::updateRecur(QDeclarativeEngine *engine, const QMetaObject *metaObject)