aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvmemetaobject_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-03-12 13:00:46 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-13 13:58:40 +0100
commit110c38a8a6fa30ad8e114d26df88fc3c23ec42de (patch)
treea1a11f0363cea0ad9220dbbe30989566c055bf0d /src/qml/qml/qqmlvmemetaobject_p.h
parent1ddd4f8f0641948aabfd1031a080720e8dc61984 (diff)
Fix property caches out of sync with grouped properties that have a VME meta object
Because QQmlObjectCreator::populateInstance would take the property cache to install from the outside and also pass it as the cache to use for the VME meta object to install, it could happen that the wrong cache was installed - the one supplied by engine->cache(propType) instead of the cache created together with the VME meta-object at type compilation time. This patch ensures that they're always in sync and correct by removing the responsibility of the caller to supply the cache to use and install. Instead the function will always use the cache calculated at type compile time (and also use that when installing the VME meta object). Installation of the property cache on the declarative data of the instance is now done only at createInstance() time, which fortunately also simplifies the code. Change-Id: Ia722cd57bc48007aaf725f1f59daa2f21569e324 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmlvmemetaobject_p.h')
-rw-r--r--src/qml/qml/qqmlvmemetaobject_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlvmemetaobject_p.h b/src/qml/qml/qqmlvmemetaobject_p.h
index 778559d0c4..50d1cf75b7 100644
--- a/src/qml/qml/qqmlvmemetaobject_p.h
+++ b/src/qml/qml/qqmlvmemetaobject_p.h
@@ -174,6 +174,9 @@ public:
virtual QAbstractDynamicMetaObject *toDynamicMetaObject(QObject *o);
+ // Used by auto-tests for inspection
+ QQmlPropertyCache *propertyCache() const { return cache; }
+
static inline QQmlVMEMetaObject *get(QObject *o);
static QQmlVMEMetaObject *getForProperty(QObject *o, int coreIndex);
static QQmlVMEMetaObject *getForMethod(QObject *o, int coreIndex);