*/
int QMetaObject::static_metacall(Call cl, int idx, void **argv) const
{
- const QMetaObjectExtraData *extra = reinterpret_cast<const QMetaObjectExtraData *>(d.extradata);
Q_ASSERT(priv(d.data)->revision >= 6);
- if (!extra || !extra->static_metacall)
+ if (!d.static_metacall)
return 0;
- extra->static_metacall(0, cl, idx, argv);
+ d.static_metacall(0, cl, idx, argv);
return -1;
}
while (self) {
if (strcmp(rawStringData(self, 0), name) == 0)
return self;
- if (self->d.extradata) {
- const QMetaObject **e;
+ if (self->d.relatedMetaObjects) {
Q_ASSERT(priv(self->d.data)->revision >= 2);
- const QMetaObjectExtraData *extra = (const QMetaObjectExtraData*)(self->d.extradata);
- e = extra->objects;
+ const QMetaObject **e = self->d.relatedMetaObjects;
if (e) {
while (*e) {
if (const QMetaObject *m =QMetaObject_findMetaObject((*e), name))
int idx_relative = ((handle - priv(mobj->d.data)->methodData) / 5);
int idx_offset = mobj->methodOffset();
Q_ASSERT(QMetaObjectPrivate::get(mobj)->revision >= 6);
- QObjectPrivate::StaticMetaCallFunction callFunction = mobj->d.extradata
- ? reinterpret_cast<const QMetaObjectExtraData *>(mobj->d.extradata)->static_metacall : 0;
+ QObjectPrivate::StaticMetaCallFunction callFunction = mobj->d.static_metacall;
if (connectionType == Qt::DirectConnection) {
if (callFunction) {
}
if ((members & RelatedMetaObjects) != 0) {
- const QMetaObject **objects;
Q_ASSERT(priv(prototype->d.data)->revision >= 2);
- const QMetaObjectExtraData *extra = (const QMetaObjectExtraData *)(prototype->d.extradata);
- if (extra)
- objects = extra->objects;
- else
- objects = 0;
+ const QMetaObject **objects = prototype->d.relatedMetaObjects;
if (objects) {
while (*objects != 0) {
addRelatedMetaObject(*objects);
if ((members & StaticMetacall) != 0) {
Q_ASSERT(priv(prototype->d.data)->revision >= 6);
- const QMetaObjectExtraData *extra =
- (const QMetaObjectExtraData *)(prototype->d.extradata);
- if (extra && extra->static_metacall)
- setStaticMetacallFunction(extra->static_metacall);
+ if (prototype->d.static_metacall)
+ setStaticMetacallFunction(prototype->d.static_metacall);
}
}
// Build a QMetaObject in "buf" based on the information in "d".
// If "buf" is null, then return the number of bytes needed to
// build the QMetaObject. Returns -1 if the metaobject if
-// relocatable is set, but the metaobject contains extradata.
+// relocatable is set, but the metaobject contains relatedMetaObjects.
static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf,
int expectedSize, bool relocatable)
{
ALIGN(size, int);
if (buf) {
if (!relocatable) meta->d.superdata = d->superClass;
+ meta->d.relatedMetaObjects = 0;
meta->d.extradata = 0;
+ meta->d.static_metacall = d->staticMetacallFunction;
}
// Populate the QMetaObjectPrivate structure.
if (buf)
data[enumIndex] = 0;
- // Create the extradata block if we need one.
- if (d->relatedMetaObjects.size() > 0 || d->staticMetacallFunction) {
- ALIGN(size, QMetaObject **);
- ALIGN(size, QMetaObjectBuilder::StaticMetacallFunction);
- QMetaObjectExtraData *extra =
- reinterpret_cast<QMetaObjectExtraData *>(buf + size);
- size += sizeof(QMetaObjectExtraData);
+ // Create the relatedMetaObjects block if we need one.
+ if (d->relatedMetaObjects.size() > 0) {
ALIGN(size, QMetaObject *);
const QMetaObject **objects =
reinterpret_cast<const QMetaObject **>(buf + size);
if (buf) {
- if (d->relatedMetaObjects.size() > 0) {
- extra->objects = objects;
- for (index = 0; index < d->relatedMetaObjects.size(); ++index)
- objects[index] = d->relatedMetaObjects[index];
- objects[index] = 0;
- } else {
- extra->objects = 0;
- }
- extra->static_metacall = d->staticMetacallFunction;
- meta->d.extradata = reinterpret_cast<void *>(extra);
+ meta->d.relatedMetaObjects = objects;
+ for (index = 0; index < d->relatedMetaObjects.size(); ++index)
+ objects[index] = d->relatedMetaObjects[index];
+ objects[index] = 0;
}
- if (d->relatedMetaObjects.size() > 0)
- size += sizeof(QMetaObject *) * (d->relatedMetaObjects.size() + 1);
+ size += sizeof(QMetaObject *) * (d->relatedMetaObjects.size() + 1);
}
// Align the final size and return it.
output->d.stringdata = reinterpret_cast<const QByteArrayData *>(buf + stringdataOffset);
output->d.data = reinterpret_cast<const uint *>(buf + dataOffset);
output->d.extradata = 0;
+ output->d.relatedMetaObjects = 0;
}
/*!
int indexOfEnumerator(const QByteArray& name);
int indexOfClassInfo(const QByteArray& name);
- typedef QMetaObjectExtraData::StaticMetacallFunction StaticMetacallFunction;
+ typedef void (*StaticMetacallFunction)(QObject *, QMetaObject::Call, int, void **);
QMetaObjectBuilder::StaticMetacallFunction staticMetacallFunction() const;
void setStaticMetacallFunction(QMetaObjectBuilder::StaticMetacallFunction value);
int method_offset = rmeta ? rmeta->methodOffset() : 0;
Q_ASSERT(!rmeta || QMetaObjectPrivate::get(rmeta)->revision >= 6);
QObjectPrivate::StaticMetaCallFunction callFunction =
- (rmeta && rmeta->d.extradata)
- ? reinterpret_cast<const QMetaObjectExtraData *>(rmeta->d.extradata)->static_metacall : 0;
+ rmeta ? rmeta->d.static_metacall : 0;
QOrderedMutexLocker locker(signalSlotLock(sender),
signalSlotLock(receiver));
class QString;
#ifndef Q_MOC_OUTPUT_REVISION
-#define Q_MOC_OUTPUT_REVISION 65
+#define Q_MOC_OUTPUT_REVISION 66
#endif
// The following macros are our "extensions" to C++
QT_TR_FUNCTIONS \
virtual int qt_metacall(QMetaObject::Call, int, void **); \
private: \
- Q_DECL_HIDDEN static const QMetaObjectExtraData staticMetaObjectExtraData; \
Q_DECL_HIDDEN_STATIC_METACALL static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);
/* tmake ignore Q_OBJECT */
const QMetaObject *superdata;
const QByteArrayData *stringdata;
const uint *data;
- const void *extradata;
+ typedef void (*StaticMetacallFunction)(QObject *, QMetaObject::Call, int, void **);
+ StaticMetacallFunction static_metacall;
+ const QMetaObject **relatedMetaObjects;
+ void *extradata; //reserved for future use
} d;
};
#endif
};
-typedef const QMetaObject& (*QMetaObjectAccessor)();
-
-struct QMetaObjectExtraData
-{
- const QMetaObject **objects;
-
- typedef void (*StaticMetacallFunction)(QObject *, QMetaObject::Call, int, void **); //from revision 6
- //typedef int (*StaticMetaCall)(QMetaObject::Call, int, void **); //used from revison 2 until revison 5
- StaticMetacallFunction static_metacall;
-};
-
inline const QMetaObject *QMetaObject::superClass() const
{ return d.superdata; }
Q_UNUSED(_a);
}
-const QMetaObjectExtraData QSignalEventGenerator::staticMetaObjectExtraData = {
- 0, qt_static_metacall
-};
-
const QMetaObject QSignalEventGenerator::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_QSignalEventGenerator.data,
- qt_meta_data_QSignalEventGenerator, &staticMetaObjectExtraData }
+ qt_meta_data_QSignalEventGenerator, qt_static_metacall, 0, 0 }
};
const QMetaObject *QSignalEventGenerator::metaObject() const
}
}
-const QMetaObjectExtraData QDBusAdaptorConnector::staticMetaObjectExtraData = {
- 0, qt_static_metacall
-};
-
const QMetaObject QDBusAdaptorConnector::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_QDBusAdaptorConnector.data,
- qt_meta_data_QDBusAdaptorConnector, &staticMetaObjectExtraData }
+ qt_meta_data_QDBusAdaptorConnector, qt_static_metacall, 0, 0 }
};
const QMetaObject *QDBusAdaptorConnector::metaObject() const
// put the metaobject together
obj->d.data = uint_data;
+ obj->d.relatedMetaObjects = 0;
+ obj->d.static_metacall = 0;
obj->d.extradata = 0;
obj->d.stringdata = reinterpret_cast<const QByteArrayData *>(string_data);
obj->d.superdata = &QDBusAbstractInterface::staticMetaObject;
stringdata[name.length()] = '\0';
d.data = reinterpret_cast<uint*>(header);
+ d.relatedMetaObjects = 0;
+ d.static_metacall = 0;
d.extradata = 0;
d.stringdata = stringdata;
d.superdata = &QDBusAbstractInterface::staticMetaObject;
fprintf(out, " 0\n};\n\n");
}
- bool hasExtraData = (cdef->hasQObject && !isQt) || !extraList.isEmpty();
- if (hasExtraData) {
- fprintf(out, "const QMetaObjectExtraData %s::staticMetaObjectExtraData = {\n ",
- cdef->qualified.constData());
- if (extraList.isEmpty())
- fprintf(out, "0, ");
- else
- fprintf(out, "qt_meta_extradata_%s, ", qualifiedClassNameIdentifier.constData());
-
- if (cdef->hasQObject && !isQt)
- fprintf(out, " qt_static_metacall");
- else
- fprintf(out, " 0");
- fprintf(out, " \n};\n\n");
- }
-
//
// Finally create and initialize the static meta object
//
fprintf(out, "qt_meta_stringdata_%s.data,\n"
" qt_meta_data_%s, ", qualifiedClassNameIdentifier.constData(),
qualifiedClassNameIdentifier.constData());
- if (!hasExtraData)
- fprintf(out, "0 }\n");
+ if (cdef->hasQObject && !isQt)
+ fprintf(out, " qt_static_metacall, ");
else
- fprintf(out, "&staticMetaObjectExtraData }\n");
- fprintf(out, "};\n");
+ fprintf(out, " 0, ");
+
+ if (extraList.isEmpty())
+ fprintf(out, "0, ");
+ else
+ fprintf(out, "qt_meta_extradata_%s, ", qualifiedClassNameIdentifier.constData());
+ fprintf(out, "0}\n};\n\n");
if(isQt)
return;
-
if (!cdef->hasQObject)
return;
#define OUTPUTREVISION_H
// if the output revision changes, you MUST change it in qobjectdefs.h too
-enum { mocOutputRevision = 65 }; // moc format output revision
+enum { mocOutputRevision = 66 }; // moc format output revision
#endif // OUTPUTREVISION_H
return false;
}
- const QMetaObject **objects1 = 0;
- const QMetaObject **objects2 = 0;
- if (meta1->d.data[0] == meta2->d.data[0] && meta1->d.data[0] >= 2) {
- QMetaObjectExtraData *extra1 = (QMetaObjectExtraData *)(meta1->d.extradata);
- QMetaObjectExtraData *extra2 = (QMetaObjectExtraData *)(meta2->d.extradata);
- if (extra1 && !extra2)
- return false;
- if (extra2 && !extra1)
- return false;
- if (extra1 && extra2) {
- if (extra1->static_metacall != extra2->static_metacall)
- return false;
- objects1 = extra1->objects;
- objects2 = extra1->objects;
- }
- } else if (meta1->d.data[0] == meta2->d.data[0] && meta1->d.data[0] == 1) {
- objects1 = (const QMetaObject **)(meta1->d.extradata);
- objects2 = (const QMetaObject **)(meta2->d.extradata);
- }
+ const QMetaObject **objects1 = meta1->d.relatedMetaObjects;
+ const QMetaObject **objects2 = meta2->d.relatedMetaObjects;
if (objects1 && !objects2)
return false;
if (objects2 && !objects1)
};
QMetaObject TestObject::staticMetaObject = {
- { 0, 0, 0, 0 }
+ { 0, 0, 0, 0, 0, 0 }
};
TestObject::TestObject(QObject *parent)
const QMetaObject *mobjUser = &EnumUserClass::staticMetaObject;
QCOMPARE(mobjUser->enumeratorCount(), 0);
- const QMetaObjectExtraData *extra = reinterpret_cast<const QMetaObjectExtraData *>(mobjUser->d.extradata);
- QVERIFY(extra);
-
- const QMetaObject **objects = extra->objects;
+ const QMetaObject **objects = mobjUser->d.relatedMetaObjects;
QVERIFY(objects);
QVERIFY(objects[0] == mobjSource);
QVERIFY(objects[1] == 0);