summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative')
-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) {