summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetaobject.h
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2020-04-01 09:23:53 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2020-06-11 19:39:54 +0200
commit630c7b481184b5e0dd2e87b967fed421d574ee02 (patch)
treea6d95f0a479d47c12d791348331f4ab4a215147e /src/corelib/kernel/qmetaobject.h
parent5603be705e9e99b164bb85014c2abd0edf1d13f3 (diff)
Cleanups in QMetaProperty
This changes the layout of the meta object data, so also bump the meta object revision. Original-patch-by: Lars Knoll <lars.knoll@qt.io> Change-Id: I176fb16c207e8ebe59e358e69554be813406232f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/corelib/kernel/qmetaobject.h')
-rw-r--r--src/corelib/kernel/qmetaobject.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/corelib/kernel/qmetaobject.h b/src/corelib/kernel/qmetaobject.h
index c16cdb129a..0dcc74e120 100644
--- a/src/corelib/kernel/qmetaobject.h
+++ b/src/corelib/kernel/qmetaobject.h
@@ -276,7 +276,7 @@ Q_DECLARE_TYPEINFO(QMetaEnum, Q_MOVABLE_TYPE);
class Q_CORE_EXPORT QMetaProperty
{
public:
- QMetaProperty();
+ constexpr QMetaProperty() : mobj(nullptr), data({ nullptr }), idx(-1) {}
const char *name() const;
const char *typeName() const;
@@ -326,8 +326,22 @@ public:
private:
int registerPropertyType() const;
+ struct Data {
+ enum { Size = 5 };
+
+ uint name() const { return d[0]; }
+ uint type() const { return d[1]; }
+ uint flags() const { return d[2]; }
+ uint notifyIndex() const { return d[3]; }
+ uint revision() const { return d[4]; }
+
+ const uint *d;
+ };
+
+ QMetaProperty(const QMetaObject *mobj, int index);
+
const QMetaObject *mobj;
- uint handle;
+ Data data;
int idx;
QMetaEnum menum;
friend struct QMetaObject;