diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-12-06 04:23:47 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2011-01-05 03:15:43 (GMT) |
commit | 3f80a24c5d375dd173d18c2a4227301f1afba2e3 (patch) | |
tree | 1d1a8ae2fb54082fa4e79a04263b44c6929d5f2a /src/tools/moc/moc.h | |
parent | 086f33dd4c70be03adcbc1703997afa27add920b (diff) | |
download | Qt-3f80a24c5d375dd173d18c2a4227301f1afba2e3.zip Qt-3f80a24c5d375dd173d18c2a4227301f1afba2e3.tar.gz Qt-3f80a24c5d375dd173d18c2a4227301f1afba2e3.tar.bz2 |
Allow a revision to be associated with properties and methods.
Allows a revision to be associated with properties via:
Q_PROPERTY(int prop READ prop1 REVISION 1)
Allows a revision to be associated with methods via either:
public slots Q_REVISION(1):
void method1();
or:
public slots:
Q_REVISION void method1();
Private revision() methods are added to QMetaProperty and QMetaMethod
to access the revision info. This is private API for use by QML for
now.
Task-number: QTBUG-13451
Reviewed-by: Kent Hansen
Diffstat (limited to 'src/tools/moc/moc.h')
-rw-r--r-- | src/tools/moc/moc.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h index 5e47d9a..c07ec0b 100644 --- a/src/tools/moc/moc.h +++ b/src/tools/moc/moc.h @@ -86,7 +86,7 @@ struct FunctionDef FunctionDef(): returnTypeIsVolatile(false), access(Private), isConst(false), isVirtual(false), inlineCode(false), wasCloned(false), isCompat(false), isInvokable(false), isScriptable(false), isSlot(false), isSignal(false), - isConstructor(false), isDestructor(false), isAbstract(false) {} + isConstructor(false), isDestructor(false), isAbstract(false), revision(0) {} Type type; QByteArray normalizedType; QByteArray tag; @@ -111,11 +111,13 @@ struct FunctionDef bool isConstructor; bool isDestructor; bool isAbstract; + + int revision; }; struct PropertyDef { - PropertyDef():notifyId(-1), constant(false), final(false), gspec(ValueSpec){} + PropertyDef():notifyId(-1), constant(false), final(false), gspec(ValueSpec), revision(0){} QByteArray name, type, read, write, reset, designable, scriptable, editable, stored, user, notify, inPrivateClass; int notifyId; bool constant; @@ -128,6 +130,7 @@ struct PropertyDef s += name.mid(1); return (s == write); } + int revision; }; @@ -139,7 +142,8 @@ struct ClassInfoDef struct ClassDef { ClassDef(): - hasQObject(false), hasQGadget(false), notifyableProperties(0), begin(0), end(0){} + hasQObject(false), hasQGadget(false), notifyableProperties(0) + , revisionedMethods(0), revisionedProperties(0), begin(0), end(0){} QByteArray classname; QByteArray qualified; QList<QPair<QByteArray, FunctionDef::Access> > superclassList; @@ -164,6 +168,8 @@ struct ClassDef { QMap<QByteArray, bool> enumDeclarations; QList<EnumDef> enumList; QMap<QByteArray, QByteArray> flagAliases; + int revisionedMethods; + int revisionedProperties; int begin; int end; @@ -236,6 +242,7 @@ public: // in FunctionDef accordingly bool testFunctionAttribute(FunctionDef *def); bool testFunctionAttribute(Token tok, FunctionDef *def); + bool testFunctionRevision(FunctionDef *def); void checkSuperClasses(ClassDef *def); void checkProperties(ClassDef* cdef); |