summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel/qobject/moc_oldnormalizeobject.cpp
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-02-18 20:36:06 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-29 12:50:14 +0100
commit3f7a222414fc9d3e9f2e2cfdd05f33740c5afb7e (patch)
tree55f95e0291331be96349ad2909ab99bfd128ae78 /tests/auto/corelib/kernel/qobject/moc_oldnormalizeobject.cpp
parent02c1863485ec26ab6756fd7ec85d60d3bce68eb3 (diff)
Change the representation of meta-object string data
Up to and including meta-object revision 6, string data have been stored as 0-terminated C-style strings, that were made directly accessible as const char pointers through the public API (QMetaMethod and friends). This commit changes moc to generate an array of QByteArrayData instead, and adapts the QObject kernel accordingly. Generating an array of QByteArrayData (byte array literals) means that the strings can now be returned from public (or private) API as QByteArrays, rather than const char *, with zero allocation or copying. Also, the string length is now computed at compile time (it's part of the QByteArrayData). This commit only changes the internal representation, and does not affect existing public API. The actual (C) string data that the byte array literals reference still consists of zero-terminated strings. The benefit of having the QByteArrayData array will only become apparent in the upcoming meta-object data format change, which changes the format of property and method descriptors. Support for the old meta-object string data format was kept; the codepaths for old revisions (6 and below) will be removed in a separate commit, once all the other meta-object changes are done and affected code has been adapted accordingly. Task-number: QTBUG-24154 Change-Id: I4ec3b363bbc31b8192e5d8915ef091c442c2efad Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'tests/auto/corelib/kernel/qobject/moc_oldnormalizeobject.cpp')
-rw-r--r--tests/auto/corelib/kernel/qobject/moc_oldnormalizeobject.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/kernel/qobject/moc_oldnormalizeobject.cpp b/tests/auto/corelib/kernel/qobject/moc_oldnormalizeobject.cpp
index 2d180b88ea..021079a8e7 100644
--- a/tests/auto/corelib/kernel/qobject/moc_oldnormalizeobject.cpp
+++ b/tests/auto/corelib/kernel/qobject/moc_oldnormalizeobject.cpp
@@ -90,7 +90,7 @@ static const char qt_meta_stringdata_OldNormalizeObject[] = {
};
const QMetaObject OldNormalizeObject::staticMetaObject = {
- { &QObject::staticMetaObject, qt_meta_stringdata_OldNormalizeObject,
+ { &QObject::staticMetaObject, reinterpret_cast<const QByteArrayData *>(qt_meta_stringdata_OldNormalizeObject),
qt_meta_data_OldNormalizeObject, 0 }
};