summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-02-01 17:42:00 +1000
committerAndrew den Exter <andrew.den-exter@nokia.com>2012-02-02 00:08:39 +0100
commit4af3a3abdef768ff067fa23e6dece058d7a6b9e1 (patch)
tree9f4efa96de1488cc5784e98fecf04082d396eaec /src/declarative/qml
parent2a538e1c5f18b63dc81c6b660f7782fc25de54f3 (diff)
Fix qdeclarativeecmascript test failure.
Don't use hardcoded constants for the number of methods belonging to QObject as they can and have changed. Change-Id: Iaae3bb6cad34fce6c2351217480755f1ac2f6085 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qdeclarativepropertycache.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/declarative/qml/qdeclarativepropertycache.cpp b/src/declarative/qml/qdeclarativepropertycache.cpp
index 6b08f1b0..be8f3519 100644
--- a/src/declarative/qml/qdeclarativepropertycache.cpp
+++ b/src/declarative/qml/qdeclarativepropertycache.cpp
@@ -190,7 +190,9 @@ QDeclarativePropertyCache::Data QDeclarativePropertyCache::create(const QMetaObj
}
int methodCount = metaObject->methodCount();
- for (int ii = methodCount - 1; ii >= 3; --ii) { // >=3 to block the destroyed signal and deleteLater() slot
+ // >=QObject::staticMetaObject.methodCount() to block the destroyed signal and deleteLater() slot
+ // and other QObject methods.
+ for (int ii = methodCount - 1; ii >= QObject::staticMetaObject.methodCount(); --ii) {
QMetaMethod m = metaObject->method(ii);
if (m.access() == QMetaMethod::Private)
continue;
@@ -248,8 +250,8 @@ void QDeclarativePropertyCache::append(QDeclarativeEngine *engine, const QMetaOb
QDeclarativeEnginePrivate *enginePriv = QDeclarativeEnginePrivate::get(engine);
int methodCount = metaObject->methodCount();
- // 3 to block the destroyed signal and the deleteLater() slot
- int methodOffset = qMax(3, metaObject->methodOffset());
+ // QObject::staticMetaObject.methodCount() to block the destroyed signal and the deleteLater() slot
+ int methodOffset = qMax(QObject::staticMetaObject.methodCount(), metaObject->methodOffset());
methodIndexCache.resize(methodCount);
for (int ii = methodOffset; ii < methodCount; ++ii) {