aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/util
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-06-23 12:10:23 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2017-08-02 16:32:46 +0000
commitdb1034d093d76b4b6e66fcdd178800e0cf9d1005 (patch)
treed486a7b602a00e38dc504f70e86830683a8d04fe /src/qml/util
parent49a11e882059ee1729f776722e085dd21d378c36 (diff)
Move the engine pointer from the property cache to the VME meta object
This is where it belongs, and it makes the PropertyCache independent of the engine used. Task-number: QTBUG-61536 Change-Id: I21c2674ee3e2895abd2418764d140b154b47b868 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/util')
-rw-r--r--src/qml/util/qqmladaptormodel.cpp15
-rw-r--r--src/qml/util/qqmladaptormodel_p.h5
2 files changed, 8 insertions, 12 deletions
diff --git a/src/qml/util/qqmladaptormodel.cpp b/src/qml/util/qqmladaptormodel.cpp
index d4aa2e19ed..2d93c331cc 100644
--- a/src/qml/util/qqmladaptormodel.cpp
+++ b/src/qml/util/qqmladaptormodel.cpp
@@ -515,16 +515,15 @@ public:
QQmlDelegateModelItem *createItem(
QQmlAdaptorModel &model,
QQmlDelegateModelItemMetaType *metaType,
- QQmlEngine *engine,
- int index) const
+ int index) const Q_DECL_OVERRIDE
{
VDMAbstractItemModelDataType *dataType = const_cast<VDMAbstractItemModelDataType *>(this);
if (!metaObject)
- dataType->initializeMetaType(model, engine);
+ dataType->initializeMetaType(model);
return new QQmlDMAbstractItemModelData(metaType, dataType, index);
}
- void initializeMetaType(QQmlAdaptorModel &model, QQmlEngine *engine)
+ void initializeMetaType(QQmlAdaptorModel &model)
{
QMetaObjectBuilder builder;
setModelDataType<QQmlDMAbstractItemModelData>(&builder, this);
@@ -549,7 +548,7 @@ public:
metaObject = builder.toMetaObject();
*static_cast<QMetaObject *>(this) = *metaObject;
- propertyCache = new QQmlPropertyCache(QV8Engine::getV4(engine), metaObject);
+ propertyCache = new QQmlPropertyCache(metaObject);
}
};
@@ -661,8 +660,7 @@ public:
QQmlDelegateModelItem *createItem(
QQmlAdaptorModel &model,
QQmlDelegateModelItemMetaType *metaType,
- QQmlEngine *,
- int index) const
+ int index) const Q_DECL_OVERRIDE
{
return new QQmlDMListAccessorData(
metaType,
@@ -746,8 +744,7 @@ public:
QQmlDelegateModelItem *createItem(
QQmlAdaptorModel &model,
QQmlDelegateModelItemMetaType *metaType,
- QQmlEngine *,
- int index) const
+ int index) const Q_DECL_OVERRIDE
{
VDMObjectDelegateDataType *dataType = const_cast<VDMObjectDelegateDataType *>(this);
if (!metaObject)
diff --git a/src/qml/util/qqmladaptormodel_p.h b/src/qml/util/qqmladaptormodel_p.h
index 78d964236e..7bbddcff07 100644
--- a/src/qml/util/qqmladaptormodel_p.h
+++ b/src/qml/util/qqmladaptormodel_p.h
@@ -82,7 +82,6 @@ public:
virtual QQmlDelegateModelItem *createItem(
QQmlAdaptorModel &,
QQmlDelegateModelItemMetaType *,
- QQmlEngine *,
int) const { return 0; }
virtual bool notify(
@@ -122,8 +121,8 @@ public:
inline int count() const { return qMax(0, accessors->count(*this)); }
inline QVariant value(int index, const QString &role) const {
return accessors->value(*this, index, role); }
- inline QQmlDelegateModelItem *createItem(QQmlDelegateModelItemMetaType *metaType, QQmlEngine *engine, int index) {
- return accessors->createItem(*this, metaType, engine, index); }
+ inline QQmlDelegateModelItem *createItem(QQmlDelegateModelItemMetaType *metaType, int index) {
+ return accessors->createItem(*this, metaType, index); }
inline bool hasProxyObject() const {
return list.type() == QQmlListAccessor::Instance || list.type() == QQmlListAccessor::ListProperty; }