summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/generator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/moc/generator.cpp')
-rw-r--r--src/tools/moc/generator.cpp53
1 files changed, 6 insertions, 47 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index f19c94b..cc6fa88 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -45,44 +45,9 @@
#include <QtCore/qmetatype.h>
#include <stdio.h>
-QT_BEGIN_NAMESPACE
+#include <private/qmetaobject_p.h> //for the flags.
-// if the flags change, you MUST to change it in qmetaobject.cpp too
-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
-};
-
-enum MethodFlags {
- AccessPrivate = 0x00,
- AccessProtected = 0x01,
- AccessPublic = 0x02,
- MethodMethod = 0x00,
- MethodSignal = 0x04,
- MethodSlot = 0x08,
- MethodConstructor = 0x0c,
- MethodCompatibility = 0x10,
- MethodCloned = 0x20,
- MethodScriptable = 0x40
-};
+QT_BEGIN_NAMESPACE
uint qvariant_nameToType(const char* name)
{
@@ -205,10 +170,10 @@ void Generator::generateCode()
QByteArray qualifiedClassNameIdentifier = cdef->qualified;
qualifiedClassNameIdentifier.replace(':', '_');
- int index = 13;
+ int index = 14;
fprintf(out, "static const uint qt_meta_data_%s[] = {\n", qualifiedClassNameIdentifier.constData());
fprintf(out, "\n // content:\n");
- fprintf(out, " %4d, // revision\n", 3);
+ fprintf(out, " %4d, // revision\n", 4);
fprintf(out, " %4d, // classname\n", strreg(cdef->qualified));
fprintf(out, " %4d, %4d, // classinfo\n", cdef->classInfoList.count(), cdef->classInfoList.count() ? index : 0);
index += cdef->classInfoList.count() * 2;
@@ -229,6 +194,7 @@ void Generator::generateCode()
isConstructible ? index : 0);
fprintf(out, " %4d, // flags\n", 0);
+ fprintf(out, " %4d, // signalCount\n", cdef->signalList.count());
//
@@ -1016,14 +982,7 @@ void Generator::generateSignal(FunctionDef *def,int index)
else
fprintf(out, ", const_cast<void*>(reinterpret_cast<const void*>(&_t%d))", i);
fprintf(out, " };\n");
- int n = 0;
- for (i = 0; i < def->arguments.count(); ++i)
- if (def->arguments.at(i).isDefault)
- ++n;
- if (n)
- fprintf(out, " QMetaObject::activate(%s, &staticMetaObject, %d, %d, _a);\n", thisPtr.constData(), index, index + n);
- else
- fprintf(out, " QMetaObject::activate(%s, &staticMetaObject, %d, _a);\n", thisPtr.constData(), index);
+ fprintf(out, " QMetaObject::activate(%s, &staticMetaObject, %d, _a);\n", thisPtr.constData(), index);
if (def->normalizedType.size())
fprintf(out, " return _t0;\n");
fprintf(out, "}\n");