QFastMetaBuilder: Generate revision 6 meta-objects
authorKent Hansen <kent.hansen@nokia.com>
Tue, 7 Feb 2012 12:29:58 +0000 (13:29 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 29 Feb 2012 07:05:22 +0000 (08:05 +0100)
Support for old meta-object revisions (<= 6) will be dropped in Qt5.
The first, simple step towards revision 7 is to move from rev 4 to 6.

Also avoid copy/paste of the flags/types defined in qmetaobject_p.h
(in preparation of porting to revision 7).

Change-Id: I8ec3ad0811295528303abb5cce86011fc869ec30
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
src/declarative/qml/ftw/qfastmetabuilder.cpp

index 0395ab3..327ed86 100644 (file)
@@ -42,6 +42,8 @@
 #include "qfastmetabuilder_p.h"
 
 #include <QtCore/qmetaobject.h>
+#include <private/qobject_p.h>
+#include <private/qmetaobject_p.h>
 
 QT_BEGIN_NAMESPACE
 
@@ -50,65 +52,6 @@ struct QFastMetaBuilderHeader
     int fieldCount;
 };
 
-struct QMetaObjectPrivate 
-{
-    int revision;
-    int className;
-    int classInfoCount, classInfoData;
-    int methodCount, methodData;
-    int propertyCount, propertyData;
-    int enumeratorCount, enumeratorData;
-    int constructorCount, constructorData; //since revision 2
-    int flags; //since revision 3
-    int signalCount; //since revision 4
-};
-
-enum MetaObjectFlag {
-    DynamicMetaObject = 0x01
-};
-
-enum PropertyFlags  {
-    Invalid = 0x00000000,
-    Readable = 0x00000001,
-    Writable = 0x00000002,
-    Resettable = 0x00000004,
-    EnumOrFlag = 0x00000008,
-    StdCppSet = 0x00000100,
-//     Override = 0x00000200,
-    Constant = 0x00000400,
-    Final = 0x00000800,
-    Designable = 0x00001000,
-    ResolveDesignable = 0x00002000,
-    Scriptable = 0x00004000,
-    ResolveScriptable = 0x00008000,
-    Stored = 0x00010000,
-    ResolveStored = 0x00020000,
-    Editable = 0x00040000,
-    ResolveEditable = 0x00080000,
-    User = 0x00100000,
-    ResolveUser = 0x00200000,
-    Notify = 0x00400000,
-    Revisioned = 0x00800000
-};
-
-enum MethodFlags  {
-    AccessPrivate = 0x00,
-    AccessProtected = 0x01,
-    AccessPublic = 0x02,
-    AccessMask = 0x03, //mask
-
-    MethodMethod = 0x00,
-    MethodSignal = 0x04,
-    MethodSlot = 0x08,
-    MethodConstructor = 0x0c,
-    MethodTypeMask = 0x0c,
-
-    MethodCompatibility = 0x10,
-    MethodCloned = 0x20,
-    MethodScriptable = 0x40,
-    MethodRevisioned = 0x80
-};
-
 #define FMBHEADER_FIELD_COUNT 1
 
 #define HEADER_FIELD_COUNT 14
@@ -175,7 +118,7 @@ QFastMetaBuilder::StringRef QFastMetaBuilder::init(int classNameLength,
 
     int dataIndex = HEADER_FIELD_COUNT;
 
-    p->revision = 4;
+    p->revision = 6;
     p->className = 0;
 
     // Class infos
@@ -364,6 +307,7 @@ void QFastMetaBuilder::fromData(QMetaObject *output, const QMetaObject *parent,
     output->d.superdata = parent;
     output->d.stringdata = data.constData() + header(data)->fieldCount * sizeof(uint);
     output->d.data = fieldPointer(data);
+    output->d.extradata = 0;
 }
 
 QT_END_NAMESPACE