diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-02-18 20:36:06 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-29 12:50:14 +0100 |
commit | 3f7a222414fc9d3e9f2e2cfdd05f33740c5afb7e (patch) | |
tree | 55f95e0291331be96349ad2909ab99bfd128ae78 /doc/src/snippets/code/doc_src_qtestevent.cpp | |
parent | 02c1863485ec26ab6756fd7ec85d60d3bce68eb3 (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 'doc/src/snippets/code/doc_src_qtestevent.cpp')
0 files changed, 0 insertions, 0 deletions