summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2018-08-13 09:31:07 +0200
committerKai Koehne <kai.koehne@qt.io>2018-08-14 09:34:21 +0000
commit4bbc782fc70f30e8b1530e87c85a8f453deb051d (patch)
tree4eb807c6feba3dc6e8bde3fbff6a68e940c620c7
parente75a541dbb27119c31ffd6dd36c38cd8a81f2431 (diff)
downloadqtactiveqt-4bbc782fc70f30e8b1530e87c85a8f453deb051d.tar.gz
Adapt to QMetaObjectPrivate changes in qtbase
Commit 1c623bc6d1c0a7c in qtbase bumped QMetaObjectPrivate::OutputRevision, which caused qtactiveqt builds to fail. Task-number: QTBUG-69911 Change-Id: I40be892d8c80fdc4706ae176bbafb302fdd00921 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--src/activeqt/container/qaxbase.cpp13
-rw-r--r--tools/dumpcpp/main.cpp2
2 files changed, 9 insertions, 6 deletions
diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp
index 883f1e9..bfa09a9 100644
--- a/src/activeqt/container/qaxbase.cpp
+++ b/src/activeqt/container/qaxbase.cpp
@@ -3023,7 +3023,7 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
int_data_size += classinfo_list.count() * 2;
int_data_size += (signal_list.count() + slot_list.count()) * 5 + paramsDataSize;
int_data_size += property_list.count() * 3;
- int_data_size += enum_list.count() * 4;
+ int_data_size += enum_list.count() * ((QMetaObjectPrivate::OutputRevision == 8) ? 5 : 4);
const EnumListMapConstIterator ecend = enum_list.end();
for (EnumListMapConstIterator it = enum_list.begin(); it != ecend; ++it)
int_data_size += it.value().count() * 2;
@@ -3031,7 +3031,7 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
uint *int_data = new uint[int_data_size];
QMetaObjectPrivate *header = reinterpret_cast<QMetaObjectPrivate *>(int_data);
- Q_STATIC_ASSERT_X(QMetaObjectPrivate::OutputRevision == 7, "QtDBus meta-object generator should generate the same version as moc");
+ Q_STATIC_ASSERT_X(QMetaObjectPrivate::OutputRevision == 7 || QMetaObjectPrivate::OutputRevision == 8, "QtDBus meta-object generator should generate the same version as moc");
header->revision = QMetaObjectPrivate::OutputRevision;
header->className = 0;
header->classInfoCount = classinfo_list.count();
@@ -3118,19 +3118,22 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
}
Q_ASSERT(offset == header->enumeratorData);
- int value_offset = offset + enum_list.count() * 4;
+ int value_offset = offset + enum_list.count() * ((QMetaObjectPrivate::OutputRevision == 8) ? 5 : 4);
// each enum in form name\0
for (EnumListMapConstIterator it = enum_list.begin(); it != ecend; ++it) {
QByteArray name(it.key());
int count = it.value().count();
- int_data[offset++] = uint(strings.enter(name));
+ uint nameId = uint(strings.enter(name));
+ int_data[offset++] = nameId;
+ if (QMetaObjectPrivate::OutputRevision == 8)
+ int_data[offset++] = nameId;
int_data[offset++] = 0x0; // 0x1 for flag?
int_data[offset++] = uint(count);
int_data[offset++] = uint(value_offset);
value_offset += count * 2;
}
- Q_ASSERT(offset == header->enumeratorData + enum_list.count() * 4);
+ Q_ASSERT(offset == header->enumeratorData + enum_list.count() * ((QMetaObjectPrivate::OutputRevision == 8) ? 5 : 4));
// each enum value in form key\0
for (EnumListMapConstIterator it = enum_list.begin(); it != ecend; ++it) {
diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp
index 2baad0e..caf4009 100644
--- a/tools/dumpcpp/main.cpp
+++ b/tools/dumpcpp/main.cpp
@@ -692,7 +692,7 @@ void generateMethodParameters(QTextStream &out, const QMetaObject *mo, const QMe
void generateClassImpl(QTextStream &out, const QMetaObject *mo, const QByteArray &className,
const QByteArray &nameSpace, ObjectCategories category)
{
- Q_STATIC_ASSERT_X(QMetaObjectPrivate::OutputRevision == 7, "dumpcpp should generate the same version as moc");
+ Q_STATIC_ASSERT_X(QMetaObjectPrivate::OutputRevision == 7 || QMetaObjectPrivate::OutputRevision == 8, "dumpcpp should generate the same version as moc");
QByteArray qualifiedClassName;
if (!nameSpace.isEmpty())