aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmllist_p.h
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-03-05 13:20:05 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2021-03-19 21:03:34 +0100
commit2afb055609dedb79f232b32f704cce33ffd5778d (patch)
treef278287299f374bc6390b034dcac984dad4b673e /src/qml/qml/qqmllist_p.h
parent0c066168bbbd230abe875727b2000d6828b03f23 (diff)
QQmlMetaType: Remove qmlLists member
Instead of using a hashmap which maps a QML lists metatype to its list element's metatype, we can just store a pointer in the list metatype to the element metatype. Moreover, listType now returns a metatype. This is a preparation for converting enginePriv->rawMetaObjectForType(typeId) to metaType.metaObject() calls once we can actually retrieve the metaobject from QML metatypes. The QML metatype interface classes are moved into a header, so that Qt for Python can use the same classes. This does not affect types registered from C++, as those use a different mechanism. Task-number: QTBUG-88766 Task-number: QTBUG-82931 Task-number: QTBUG-87134 Change-Id: I330c2bbe4ac92072a333c001750f7504b56df478 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/qml/qml/qqmllist_p.h')
-rw-r--r--src/qml/qml/qqmllist_p.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qml/qml/qqmllist_p.h b/src/qml/qml/qqmllist_p.h
index 022bed977e..8ce3c04abb 100644
--- a/src/qml/qml/qqmllist_p.h
+++ b/src/qml/qml/qqmllist_p.h
@@ -63,11 +63,11 @@ class QQmlListReferencePrivate
public:
QQmlListReferencePrivate();
- static QQmlListReference init(const QQmlListProperty<QObject> &, int, QQmlEngine *);
+ static QQmlListReference init(const QQmlListProperty<QObject> &, QMetaType, QQmlEngine *);
QPointer<QObject> object;
QQmlListProperty<QObject> property;
- int propertyType;
+ QMetaType propertyType;
void addref();
void release();
@@ -85,7 +85,7 @@ public:
const QMetaObject *elementType()
{
if (m_elementTypeOrEngine.isT2()) {
- const int listType = QQmlMetaType::listType(propertyType);
+ const int listType = QQmlMetaType::listType(propertyType).id();
const QQmlEngine *engine = m_elementTypeOrEngine.asT2();
const QQmlEnginePrivate *p = engine ? QQmlEnginePrivate::get(engine) : nullptr;
m_elementTypeOrEngine = p ? p->rawMetaObjectForType(listType).metaObject()