diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2020-01-10 15:25:28 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2020-01-13 15:47:56 +0100 |
commit | bb5ee926913bf00300999c940808ab1666b76806 (patch) | |
tree | 4aed4db7239fdb1c3a66b0244bdcbe1649514fc8 /tools | |
parent | 4f70870f2f0dab1d21ceaa44e9a358ab66940e01 (diff) |
Fix build of QtActiveQt after moc string data changes
Commit e58b44d557b859b7b55869f1e137aa1bc8968307 in qtbase changes the
meta-object to store string data as an array of offsets and length into
the char array instead of a synthetic QByteArrayData (in the old
format). This is a port to the new data structure.
Change-Id: Ieacfdab69d799f954d9351f8424284b1e6633698
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/dumpcpp/main.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp index 780d41b..1545a39 100644 --- a/tools/dumpcpp/main.cpp +++ b/tools/dumpcpp/main.cpp @@ -1302,7 +1302,7 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, // Build stringdata struct // implOut << "struct qt_meta_stringdata_all_t {" << Qt::endl; - implOut << " QByteArrayData data[" << strings.size() << "];" << Qt::endl; + implOut << " uint data[" << strings.size() * 2 << "];" << Qt::endl; QVector<QByteArrayList> listVector; QByteArrayList currentList; @@ -1323,16 +1323,8 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, implOut << "};" << Qt::endl; listVector.append(currentList); - // Macro that expands into a QByteArrayData. The offset member is - // calculated from 1) the offset of the actual characters in the - // stringdata.stringdata member, and 2) the stringdata.data index of the - // QByteArrayData being defined. This calculation relies on the - // QByteArrayData::data() implementation returning simply "this + offset". - implOut << "#define QT_MOC_LITERAL(idx, ofs, len, table) \\" << Qt::endl - << " Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \\" << Qt::endl - << " offsetof(qt_meta_stringdata_all_t, stringdata##table) + ofs \\" << Qt::endl - << " - idx * sizeof(QByteArrayData) \\" << Qt::endl - << " )" << Qt::endl; + implOut << "#define QT_MOC_LITERAL(ofs, len, table) \\" << Qt::endl + << " uint(offsetof(qt_meta_stringdata_all_t, stringdata##table) + ofs), len," << Qt::endl; implOut << "static const qt_meta_stringdata_all_t qt_meta_stringdata_all = {" << Qt::endl; implOut << " {" << Qt::endl; @@ -1344,7 +1336,7 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, if (totalStringCount) implOut << ',' << Qt::endl; const QByteArray &str = listVector[i].at(j); - implOut << "QT_MOC_LITERAL(" << totalStringCount++ << ", " << idx << ", " << str.length() << ", " << i << ')'; + implOut << "QT_MOC_LITERAL(" << idx << ", " << str.length() << ", " << i << ')'; idx += str.length() + 1; } } |