aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlopenmetaobject_p.h
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-10-06 13:30:19 +0200
committerUlf Hermann <ulf.hermann@qt.io>2021-10-12 19:14:47 +0200
commit63865ebd75ede8122011a19e58dc56c19978c91a (patch)
tree90f250b1c692475ea4d17407d39c82b3c80a97e5 /src/qml/qml/qqmlopenmetaobject_p.h
parent852c8d1d8a953c626735f044838454a4d249c225 (diff)
Avoid QAbstractDynamicMetaObject where possible
We don't want to copy metaobjects, but QAbstractDynamicMetaObject forces us. Rather, use plain QDynamicMetaObjectData, and store a pointer to the actual metaobject. This requires us to drop the "isDirect()" optimization for property access, as we realize that there can be dynamic meta objects which are not QAbstractDynamicMetaObject. However, this optimization was questionable anyway. What it did was cache the fact that an object might have a dynamic metaobject in a flag. Checking this on the object itself should not be much more expensive, though. On the other hand, an object might receive a dynamic metaobject individually without us adjusting flags for its type. In that case we would call the wrong method. Furthermore, most property access can be done using the static metacall function anyway. Change-Id: I5897351253496309721bd38adf3e35a1f069b080 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlopenmetaobject_p.h')
-rw-r--r--src/qml/qml/qqmlopenmetaobject_p.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlopenmetaobject_p.h b/src/qml/qml/qqmlopenmetaobject_p.h
index 47bba085b5..e455725bdf 100644
--- a/src/qml/qml/qqmlopenmetaobject_p.h
+++ b/src/qml/qml/qqmlopenmetaobject_p.h
@@ -78,7 +78,6 @@ public:
int propertyCount() const;
QByteArray propertyName(int) const;
- QMetaObject *metaObject() const;
protected:
virtual void propertyCreated(int, QMetaPropertyBuilder &);
@@ -121,6 +120,7 @@ public:
QQmlOpenMetaObjectType *type() const;
void emitPropertyNotification(const QByteArray &propertyName);
+ void unparent();
protected:
int metaCall(QObject *o, QMetaObject::Call _c, int _id, void **_a) override;
@@ -132,7 +132,7 @@ protected:
virtual void propertyWritten(int);
virtual void propertyCreated(int, QMetaPropertyBuilder &);
- QAbstractDynamicMetaObject *parent() const;
+ QDynamicMetaObjectData *parent() const;
bool checkedSetValue(int index, const QVariant &value, bool force);