Remove QMetaObjectExtraData and put everything into QMetaObject
QMetaObjectExtraData was added when support for QMetaObject::newInstance was added. One needed a place to put the pointer to static_metacall in the QMetaObject. But as we break binary compatibility, one can change the size of QMetaObject, and put everything back inside QMetaObject's own structure. Meaning it is not required anymore to have one QMetaObjectExtraData instance per QMetaObject anymore. Change-Id: If0b8f586cbaf633eed10045adee3ba3366826c86 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
This commit is contained in:
parent
7b118c6456
commit
67f58040ea
@ -288,11 +288,10 @@ QObject *QMetaObject::newInstance(QGenericArgument val0,
|
|||||||
*/
|
*/
|
||||||
int QMetaObject::static_metacall(Call cl, int idx, void **argv) const
|
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);
|
Q_ASSERT(priv(d.data)->revision >= 6);
|
||||||
if (!extra || !extra->static_metacall)
|
if (!d.static_metacall)
|
||||||
return 0;
|
return 0;
|
||||||
extra->static_metacall(0, cl, idx, argv);
|
d.static_metacall(0, cl, idx, argv);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -863,11 +862,9 @@ static const QMetaObject *QMetaObject_findMetaObject(const QMetaObject *self, co
|
|||||||
while (self) {
|
while (self) {
|
||||||
if (strcmp(rawStringData(self, 0), name) == 0)
|
if (strcmp(rawStringData(self, 0), name) == 0)
|
||||||
return self;
|
return self;
|
||||||
if (self->d.extradata) {
|
if (self->d.relatedMetaObjects) {
|
||||||
const QMetaObject **e;
|
|
||||||
Q_ASSERT(priv(self->d.data)->revision >= 2);
|
Q_ASSERT(priv(self->d.data)->revision >= 2);
|
||||||
const QMetaObjectExtraData *extra = (const QMetaObjectExtraData*)(self->d.extradata);
|
const QMetaObject **e = self->d.relatedMetaObjects;
|
||||||
e = extra->objects;
|
|
||||||
if (e) {
|
if (e) {
|
||||||
while (*e) {
|
while (*e) {
|
||||||
if (const QMetaObject *m =QMetaObject_findMetaObject((*e), name))
|
if (const QMetaObject *m =QMetaObject_findMetaObject((*e), name))
|
||||||
@ -2024,8 +2021,7 @@ bool QMetaMethod::invoke(QObject *object,
|
|||||||
int idx_relative = ((handle - priv(mobj->d.data)->methodData) / 5);
|
int idx_relative = ((handle - priv(mobj->d.data)->methodData) / 5);
|
||||||
int idx_offset = mobj->methodOffset();
|
int idx_offset = mobj->methodOffset();
|
||||||
Q_ASSERT(QMetaObjectPrivate::get(mobj)->revision >= 6);
|
Q_ASSERT(QMetaObjectPrivate::get(mobj)->revision >= 6);
|
||||||
QObjectPrivate::StaticMetaCallFunction callFunction = mobj->d.extradata
|
QObjectPrivate::StaticMetaCallFunction callFunction = mobj->d.static_metacall;
|
||||||
? reinterpret_cast<const QMetaObjectExtraData *>(mobj->d.extradata)->static_metacall : 0;
|
|
||||||
|
|
||||||
if (connectionType == Qt::DirectConnection) {
|
if (connectionType == Qt::DirectConnection) {
|
||||||
if (callFunction) {
|
if (callFunction) {
|
||||||
|
@ -737,13 +737,8 @@ void QMetaObjectBuilder::addMetaObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((members & RelatedMetaObjects) != 0) {
|
if ((members & RelatedMetaObjects) != 0) {
|
||||||
const QMetaObject **objects;
|
|
||||||
Q_ASSERT(priv(prototype->d.data)->revision >= 2);
|
Q_ASSERT(priv(prototype->d.data)->revision >= 2);
|
||||||
const QMetaObjectExtraData *extra = (const QMetaObjectExtraData *)(prototype->d.extradata);
|
const QMetaObject **objects = prototype->d.relatedMetaObjects;
|
||||||
if (extra)
|
|
||||||
objects = extra->objects;
|
|
||||||
else
|
|
||||||
objects = 0;
|
|
||||||
if (objects) {
|
if (objects) {
|
||||||
while (*objects != 0) {
|
while (*objects != 0) {
|
||||||
addRelatedMetaObject(*objects);
|
addRelatedMetaObject(*objects);
|
||||||
@ -754,10 +749,8 @@ void QMetaObjectBuilder::addMetaObject
|
|||||||
|
|
||||||
if ((members & StaticMetacall) != 0) {
|
if ((members & StaticMetacall) != 0) {
|
||||||
Q_ASSERT(priv(prototype->d.data)->revision >= 6);
|
Q_ASSERT(priv(prototype->d.data)->revision >= 6);
|
||||||
const QMetaObjectExtraData *extra =
|
if (prototype->d.static_metacall)
|
||||||
(const QMetaObjectExtraData *)(prototype->d.extradata);
|
setStaticMetacallFunction(prototype->d.static_metacall);
|
||||||
if (extra && extra->static_metacall)
|
|
||||||
setStaticMetacallFunction(extra->static_metacall);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1150,7 +1143,7 @@ static int aggregateParameterCount(const QList<QMetaMethodBuilderPrivate> &metho
|
|||||||
// Build a QMetaObject in "buf" based on the information in "d".
|
// Build a QMetaObject in "buf" based on the information in "d".
|
||||||
// If "buf" is null, then return the number of bytes needed to
|
// If "buf" is null, then return the number of bytes needed to
|
||||||
// build the QMetaObject. Returns -1 if the metaobject if
|
// 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,
|
static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf,
|
||||||
int expectedSize, bool relocatable)
|
int expectedSize, bool relocatable)
|
||||||
{
|
{
|
||||||
@ -1174,7 +1167,9 @@ static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf,
|
|||||||
ALIGN(size, int);
|
ALIGN(size, int);
|
||||||
if (buf) {
|
if (buf) {
|
||||||
if (!relocatable) meta->d.superdata = d->superClass;
|
if (!relocatable) meta->d.superdata = d->superClass;
|
||||||
|
meta->d.relatedMetaObjects = 0;
|
||||||
meta->d.extradata = 0;
|
meta->d.extradata = 0;
|
||||||
|
meta->d.static_metacall = d->staticMetacallFunction;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Populate the QMetaObjectPrivate structure.
|
// Populate the QMetaObjectPrivate structure.
|
||||||
@ -1446,30 +1441,18 @@ static int buildMetaObject(QMetaObjectBuilderPrivate *d, char *buf,
|
|||||||
if (buf)
|
if (buf)
|
||||||
data[enumIndex] = 0;
|
data[enumIndex] = 0;
|
||||||
|
|
||||||
// Create the extradata block if we need one.
|
// Create the relatedMetaObjects block if we need one.
|
||||||
if (d->relatedMetaObjects.size() > 0 || d->staticMetacallFunction) {
|
if (d->relatedMetaObjects.size() > 0) {
|
||||||
ALIGN(size, QMetaObject **);
|
|
||||||
ALIGN(size, QMetaObjectBuilder::StaticMetacallFunction);
|
|
||||||
QMetaObjectExtraData *extra =
|
|
||||||
reinterpret_cast<QMetaObjectExtraData *>(buf + size);
|
|
||||||
size += sizeof(QMetaObjectExtraData);
|
|
||||||
ALIGN(size, QMetaObject *);
|
ALIGN(size, QMetaObject *);
|
||||||
const QMetaObject **objects =
|
const QMetaObject **objects =
|
||||||
reinterpret_cast<const QMetaObject **>(buf + size);
|
reinterpret_cast<const QMetaObject **>(buf + size);
|
||||||
if (buf) {
|
if (buf) {
|
||||||
if (d->relatedMetaObjects.size() > 0) {
|
meta->d.relatedMetaObjects = objects;
|
||||||
extra->objects = objects;
|
for (index = 0; index < d->relatedMetaObjects.size(); ++index)
|
||||||
for (index = 0; index < d->relatedMetaObjects.size(); ++index)
|
objects[index] = d->relatedMetaObjects[index];
|
||||||
objects[index] = d->relatedMetaObjects[index];
|
objects[index] = 0;
|
||||||
objects[index] = 0;
|
|
||||||
} else {
|
|
||||||
extra->objects = 0;
|
|
||||||
}
|
|
||||||
extra->static_metacall = d->staticMetacallFunction;
|
|
||||||
meta->d.extradata = reinterpret_cast<void *>(extra);
|
|
||||||
}
|
}
|
||||||
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.
|
// Align the final size and return it.
|
||||||
@ -1552,6 +1535,7 @@ void QMetaObjectBuilder::fromRelocatableData(QMetaObject *output,
|
|||||||
output->d.stringdata = reinterpret_cast<const QByteArrayData *>(buf + stringdataOffset);
|
output->d.stringdata = reinterpret_cast<const QByteArrayData *>(buf + stringdataOffset);
|
||||||
output->d.data = reinterpret_cast<const uint *>(buf + dataOffset);
|
output->d.data = reinterpret_cast<const uint *>(buf + dataOffset);
|
||||||
output->d.extradata = 0;
|
output->d.extradata = 0;
|
||||||
|
output->d.relatedMetaObjects = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -165,7 +165,7 @@ public:
|
|||||||
int indexOfEnumerator(const QByteArray& name);
|
int indexOfEnumerator(const QByteArray& name);
|
||||||
int indexOfClassInfo(const QByteArray& name);
|
int indexOfClassInfo(const QByteArray& name);
|
||||||
|
|
||||||
typedef QMetaObjectExtraData::StaticMetacallFunction StaticMetacallFunction;
|
typedef void (*StaticMetacallFunction)(QObject *, QMetaObject::Call, int, void **);
|
||||||
|
|
||||||
QMetaObjectBuilder::StaticMetacallFunction staticMetacallFunction() const;
|
QMetaObjectBuilder::StaticMetacallFunction staticMetacallFunction() const;
|
||||||
void setStaticMetacallFunction(QMetaObjectBuilder::StaticMetacallFunction value);
|
void setStaticMetacallFunction(QMetaObjectBuilder::StaticMetacallFunction value);
|
||||||
|
@ -2949,8 +2949,7 @@ QObjectPrivate::Connection *QMetaObjectPrivate::connect(const QObject *sender, i
|
|||||||
int method_offset = rmeta ? rmeta->methodOffset() : 0;
|
int method_offset = rmeta ? rmeta->methodOffset() : 0;
|
||||||
Q_ASSERT(!rmeta || QMetaObjectPrivate::get(rmeta)->revision >= 6);
|
Q_ASSERT(!rmeta || QMetaObjectPrivate::get(rmeta)->revision >= 6);
|
||||||
QObjectPrivate::StaticMetaCallFunction callFunction =
|
QObjectPrivate::StaticMetaCallFunction callFunction =
|
||||||
(rmeta && rmeta->d.extradata)
|
rmeta ? rmeta->d.static_metacall : 0;
|
||||||
? reinterpret_cast<const QMetaObjectExtraData *>(rmeta->d.extradata)->static_metacall : 0;
|
|
||||||
|
|
||||||
QOrderedMutexLocker locker(signalSlotLock(sender),
|
QOrderedMutexLocker locker(signalSlotLock(sender),
|
||||||
signalSlotLock(receiver));
|
signalSlotLock(receiver));
|
||||||
|
@ -57,7 +57,7 @@ struct QByteArrayData;
|
|||||||
class QString;
|
class QString;
|
||||||
|
|
||||||
#ifndef Q_MOC_OUTPUT_REVISION
|
#ifndef Q_MOC_OUTPUT_REVISION
|
||||||
#define Q_MOC_OUTPUT_REVISION 65
|
#define Q_MOC_OUTPUT_REVISION 66
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// The following macros are our "extensions" to C++
|
// The following macros are our "extensions" to C++
|
||||||
@ -160,7 +160,6 @@ public: \
|
|||||||
QT_TR_FUNCTIONS \
|
QT_TR_FUNCTIONS \
|
||||||
virtual int qt_metacall(QMetaObject::Call, int, void **); \
|
virtual int qt_metacall(QMetaObject::Call, int, void **); \
|
||||||
private: \
|
private: \
|
||||||
Q_DECL_HIDDEN static const QMetaObjectExtraData staticMetaObjectExtraData; \
|
|
||||||
Q_DECL_HIDDEN_STATIC_METACALL static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);
|
Q_DECL_HIDDEN_STATIC_METACALL static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **);
|
||||||
|
|
||||||
/* tmake ignore Q_OBJECT */
|
/* tmake ignore Q_OBJECT */
|
||||||
@ -453,7 +452,10 @@ struct Q_CORE_EXPORT QMetaObject
|
|||||||
const QMetaObject *superdata;
|
const QMetaObject *superdata;
|
||||||
const QByteArrayData *stringdata;
|
const QByteArrayData *stringdata;
|
||||||
const uint *data;
|
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;
|
} d;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -481,17 +483,6 @@ public:
|
|||||||
#endif
|
#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
|
inline const QMetaObject *QMetaObject::superClass() const
|
||||||
{ return d.superdata; }
|
{ return d.superdata; }
|
||||||
|
|
||||||
|
@ -2265,13 +2265,9 @@ void QSignalEventGenerator::qt_static_metacall(QObject *_o, QMetaObject::Call _c
|
|||||||
Q_UNUSED(_a);
|
Q_UNUSED(_a);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QMetaObjectExtraData QSignalEventGenerator::staticMetaObjectExtraData = {
|
|
||||||
0, qt_static_metacall
|
|
||||||
};
|
|
||||||
|
|
||||||
const QMetaObject QSignalEventGenerator::staticMetaObject = {
|
const QMetaObject QSignalEventGenerator::staticMetaObject = {
|
||||||
{ &QObject::staticMetaObject, qt_meta_stringdata_QSignalEventGenerator.data,
|
{ &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 QMetaObject *QSignalEventGenerator::metaObject() const
|
||||||
|
@ -395,13 +395,9 @@ void QDBusAdaptorConnector::qt_static_metacall(QObject *_o, QMetaObject::Call _c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const QMetaObjectExtraData QDBusAdaptorConnector::staticMetaObjectExtraData = {
|
|
||||||
0, qt_static_metacall
|
|
||||||
};
|
|
||||||
|
|
||||||
const QMetaObject QDBusAdaptorConnector::staticMetaObject = {
|
const QMetaObject QDBusAdaptorConnector::staticMetaObject = {
|
||||||
{ &QObject::staticMetaObject, qt_meta_stringdata_QDBusAdaptorConnector.data,
|
{ &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
|
const QMetaObject *QDBusAdaptorConnector::metaObject() const
|
||||||
|
@ -542,6 +542,8 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
|
|||||||
|
|
||||||
// put the metaobject together
|
// put the metaobject together
|
||||||
obj->d.data = uint_data;
|
obj->d.data = uint_data;
|
||||||
|
obj->d.relatedMetaObjects = 0;
|
||||||
|
obj->d.static_metacall = 0;
|
||||||
obj->d.extradata = 0;
|
obj->d.extradata = 0;
|
||||||
obj->d.stringdata = reinterpret_cast<const QByteArrayData *>(string_data);
|
obj->d.stringdata = reinterpret_cast<const QByteArrayData *>(string_data);
|
||||||
obj->d.superdata = &QDBusAbstractInterface::staticMetaObject;
|
obj->d.superdata = &QDBusAbstractInterface::staticMetaObject;
|
||||||
@ -564,6 +566,8 @@ void QDBusMetaObjectGenerator::writeWithoutXml(const QString &interface)
|
|||||||
stringdata[name.length()] = '\0';
|
stringdata[name.length()] = '\0';
|
||||||
|
|
||||||
d.data = reinterpret_cast<uint*>(header);
|
d.data = reinterpret_cast<uint*>(header);
|
||||||
|
d.relatedMetaObjects = 0;
|
||||||
|
d.static_metacall = 0;
|
||||||
d.extradata = 0;
|
d.extradata = 0;
|
||||||
d.stringdata = stringdata;
|
d.stringdata = stringdata;
|
||||||
d.superdata = &QDBusAbstractInterface::staticMetaObject;
|
d.superdata = &QDBusAbstractInterface::staticMetaObject;
|
||||||
|
@ -415,22 +415,6 @@ void Generator::generateCode()
|
|||||||
fprintf(out, " 0\n};\n\n");
|
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
|
// Finally create and initialize the static meta object
|
||||||
//
|
//
|
||||||
@ -448,16 +432,20 @@ void Generator::generateCode()
|
|||||||
fprintf(out, "qt_meta_stringdata_%s.data,\n"
|
fprintf(out, "qt_meta_stringdata_%s.data,\n"
|
||||||
" qt_meta_data_%s, ", qualifiedClassNameIdentifier.constData(),
|
" qt_meta_data_%s, ", qualifiedClassNameIdentifier.constData(),
|
||||||
qualifiedClassNameIdentifier.constData());
|
qualifiedClassNameIdentifier.constData());
|
||||||
if (!hasExtraData)
|
if (cdef->hasQObject && !isQt)
|
||||||
fprintf(out, "0 }\n");
|
fprintf(out, " qt_static_metacall, ");
|
||||||
else
|
else
|
||||||
fprintf(out, "&staticMetaObjectExtraData }\n");
|
fprintf(out, " 0, ");
|
||||||
fprintf(out, "};\n");
|
|
||||||
|
if (extraList.isEmpty())
|
||||||
|
fprintf(out, "0, ");
|
||||||
|
else
|
||||||
|
fprintf(out, "qt_meta_extradata_%s, ", qualifiedClassNameIdentifier.constData());
|
||||||
|
fprintf(out, "0}\n};\n\n");
|
||||||
|
|
||||||
if(isQt)
|
if(isQt)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
if (!cdef->hasQObject)
|
if (!cdef->hasQObject)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -43,6 +43,6 @@
|
|||||||
#define OUTPUTREVISION_H
|
#define OUTPUTREVISION_H
|
||||||
|
|
||||||
// if the output revision changes, you MUST change it in qobjectdefs.h too
|
// 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
|
#endif // OUTPUTREVISION_H
|
||||||
|
@ -1316,25 +1316,8 @@ bool tst_QMetaObjectBuilder::sameMetaObject
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QMetaObject **objects1 = 0;
|
const QMetaObject **objects1 = meta1->d.relatedMetaObjects;
|
||||||
const QMetaObject **objects2 = 0;
|
const QMetaObject **objects2 = meta2->d.relatedMetaObjects;
|
||||||
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);
|
|
||||||
}
|
|
||||||
if (objects1 && !objects2)
|
if (objects1 && !objects2)
|
||||||
return false;
|
return false;
|
||||||
if (objects2 && !objects1)
|
if (objects2 && !objects1)
|
||||||
@ -1402,7 +1385,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
QMetaObject TestObject::staticMetaObject = {
|
QMetaObject TestObject::staticMetaObject = {
|
||||||
{ 0, 0, 0, 0 }
|
{ 0, 0, 0, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
TestObject::TestObject(QObject *parent)
|
TestObject::TestObject(QObject *parent)
|
||||||
|
@ -847,10 +847,7 @@ void tst_Moc::testExtraDataForEnum()
|
|||||||
const QMetaObject *mobjUser = &EnumUserClass::staticMetaObject;
|
const QMetaObject *mobjUser = &EnumUserClass::staticMetaObject;
|
||||||
QCOMPARE(mobjUser->enumeratorCount(), 0);
|
QCOMPARE(mobjUser->enumeratorCount(), 0);
|
||||||
|
|
||||||
const QMetaObjectExtraData *extra = reinterpret_cast<const QMetaObjectExtraData *>(mobjUser->d.extradata);
|
const QMetaObject **objects = mobjUser->d.relatedMetaObjects;
|
||||||
QVERIFY(extra);
|
|
||||||
|
|
||||||
const QMetaObject **objects = extra->objects;
|
|
||||||
QVERIFY(objects);
|
QVERIFY(objects);
|
||||||
QVERIFY(objects[0] == mobjSource);
|
QVERIFY(objects[0] == mobjSource);
|
||||||
QVERIFY(objects[1] == 0);
|
QVERIFY(objects[1] == 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user