diff options
author | BogDan Vatra <bogdan@kdab.com> | 2016-08-19 15:44:42 +0300 |
---|---|---|
committer | BogDan Vatra <bogdan@kdab.com> | 2016-08-19 15:41:27 +0000 |
commit | 691dc71a011a28743e4cdbd716c192b21d63b68b (patch) | |
tree | b54d9513c31c9bfc4d0e29819dced0ffdd3d6768 /src/tools/moc/moc.h | |
parent | a1c782062c7f2391178060a7105ad9050b1032e1 (diff) |
Say hello to Q_NAMESPACE
Q_NAMESPACE is useful to add Q_ENUM_NS/Q_ENUMS, Q_FLAG_NS/Q_FLAGS and
Q_CLASSINFO to a namespace.
[ChangeLog] Added Q_NAMESPACE which can be used to add Q_ENUM_NS/
Q_ENUMS, Q_FLAG_NS/Q_FLAGS and Q_CLASSINFO to a namespace
Task-number: QTBUG-54981
Change-Id: Ic61b972794063e77134681fb347d6c4acddcdb44
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/tools/moc/moc.h')
-rw-r--r-- | src/tools/moc/moc.h | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h index 843bdeb794..6040f944f3 100644 --- a/src/tools/moc/moc.h +++ b/src/tools/moc/moc.h @@ -144,12 +144,18 @@ struct ClassInfoDef }; Q_DECLARE_TYPEINFO(ClassInfoDef, Q_MOVABLE_TYPE); -struct ClassDef { - ClassDef(): - hasQObject(false), hasQGadget(false), notifyableProperties(0) - , revisionedMethods(0), revisionedProperties(0), begin(0), end(0){} +struct BaseDef { QByteArray classname; QByteArray qualified; + QVector<ClassInfoDef> classInfoList; + QMap<QByteArray, bool> enumDeclarations; + QVector<EnumDef> enumList; + QMap<QByteArray, QByteArray> flagAliases; + int begin = 0; + int end = 0; +}; + +struct ClassDef : BaseDef { QVector<QPair<QByteArray, FunctionDef::Access> > superclassList; struct Interface @@ -162,8 +168,8 @@ struct ClassDef { }; QVector<QVector<Interface> >interfaceList; - bool hasQObject; - bool hasQGadget; + bool hasQObject = false; + bool hasQGadget = false; struct PluginData { QByteArray iid; @@ -173,25 +179,17 @@ struct ClassDef { QVector<FunctionDef> constructorList; QVector<FunctionDef> signalList, slotList, methodList, publicList; - int notifyableProperties; + int notifyableProperties = 0; QVector<PropertyDef> propertyList; - QVector<ClassInfoDef> classInfoList; - QMap<QByteArray, bool> enumDeclarations; - QVector<EnumDef> enumList; - QMap<QByteArray, QByteArray> flagAliases; - int revisionedMethods; - int revisionedProperties; + int revisionedMethods = 0; + int revisionedProperties = 0; - int begin; - int end; }; Q_DECLARE_TYPEINFO(ClassDef, Q_MOVABLE_TYPE); Q_DECLARE_TYPEINFO(ClassDef::Interface, Q_MOVABLE_TYPE); -struct NamespaceDef { - QByteArray name; - int begin; - int end; +struct NamespaceDef : BaseDef { + bool hasQNamespace = false; }; Q_DECLARE_TYPEINFO(NamespaceDef, Q_MOVABLE_TYPE); @@ -240,9 +238,9 @@ public: void parseProperty(ClassDef *def); void parsePluginData(ClassDef *def); void createPropertyDef(PropertyDef &def); - void parseEnumOrFlag(ClassDef *def, bool isFlag); - void parseFlag(ClassDef *def); - void parseClassInfo(ClassDef *def); + void parseEnumOrFlag(BaseDef *def, bool isFlag); + void parseFlag(BaseDef *def); + void parseClassInfo(BaseDef *def); void parseInterfaces(ClassDef *def); void parseDeclareInterface(); void parseDeclareMetatype(); |