diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-02-01 17:42:00 +1000 |
---|---|---|
committer | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-02-02 00:08:39 +0100 |
commit | 4af3a3abdef768ff067fa23e6dece058d7a6b9e1 (patch) | |
tree | 9f4efa96de1488cc5784e98fecf04082d396eaec /src/declarative | |
parent | 2a538e1c5f18b63dc81c6b660f7782fc25de54f3 (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')
-rw-r--r-- | src/declarative/qml/qdeclarativepropertycache.cpp | 8 |
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) { |