summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/moc.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-11-08 16:20:44 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2020-03-18 15:42:58 +0100
commitd4f044533111fcfb34fe3a785eeb7af7fdbefbdd (patch)
tree1b2ef0c8695655e6ee4c1ae5f13a731738d1da96 /src/tools/moc/moc.h
parentb5f6a85d2745ab6ac97f593664d255906923e737 (diff)
Add support for exposing public QProperty members in the meta-object system
At the moment this makes the type as well as the setter/getter available through the meta-call as well as the ability to register observers and bindings. Only QProperty members that are annotated with Q_PROPERTY(type name) are made public through the meta-object. Change-Id: I16b98fd318122c722b85ce61e39975284e0c2404 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/tools/moc/moc.h')
-rw-r--r--src/tools/moc/moc.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h
index 743749433f..210b6c7c2a 100644
--- a/src/tools/moc/moc.h
+++ b/src/tools/moc/moc.h
@@ -140,6 +140,9 @@ struct PropertyDef
bool constant = false;
bool final = false;
bool required = false;
+ bool isQProperty = false;
+
+ int location = -1; // token index, used for error reporting
QJsonObject toJson() const;
};
@@ -188,6 +191,7 @@ struct ClassDef : BaseDef {
QVector<FunctionDef> signalList, slotList, methodList, publicList;
QVector<QByteArray> nonClassSignalList;
QVector<PropertyDef> propertyList;
+ QSet<QByteArray> qPropertyMembers;
int notifyableProperties = 0;
int revisionedMethods = 0;
int revisionedProperties = 0;
@@ -247,6 +251,7 @@ public:
bool parseFunction(FunctionDef *def, bool inMacro = false);
bool parseMaybeFunction(const ClassDef *cdef, FunctionDef *def);
+ bool parseMaybeQProperty(ClassDef *def);
void parseSlots(ClassDef *def, FunctionDef::Access access);
void parseSignals(ClassDef *def);