diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-05-24 15:33:20 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2017-06-01 10:21:48 +0000 |
commit | 49fc750ee4b17f602c054c6f812352264d973403 (patch) | |
tree | 869af2d619b7e3e197973b33637e55d12be2ef9b /src/corelib/tools/qbytearray.cpp | |
parent | 22a52d1d640f4ee6c68e8ef5da4573770efdb90a (diff) |
QStringLiteral/QByteArrayLiteral: fix/add documentation
Various editorial fixes. Also, in 5.9 QStringLiteral does
not fall back to fromUtf8 any longer, but guarantees
a compile-time construction.
Change-Id: Ida4698cf8e32a6e3de97b2c16b997fc9630c9db9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/tools/qbytearray.cpp')
-rw-r--r-- | src/corelib/tools/qbytearray.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 329cc358d4..8df439f7cd 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -4712,4 +4712,26 @@ QByteArray QByteArray::toPercentEncoding(const QByteArray &exclude, const QByteA \internal */ +/*! + \macro QByteArrayLiteral(ba) + \relates QByteArray + + The macro generates the data for a QByteArray out of the string literal + \a ba at compile time. Creating a QByteArray from it is free in this case, and + the generated byte array data is stored in the read-only segment of the + compiled object file. + + For instance: + + \code + QByteArray ba = QByteArrayLiteral("byte array contents"); + \endcode + + Using QByteArrayLiteral instead of a double quoted plain C++ string literal + can significantly speed up creation of QByteArray instances from data known + at compile time. + + \sa QStringLiteral +*/ + QT_END_NAMESPACE |