Fix qdoc warning, \function is not a command

Document the size parameter while at it, and rephrase a bit.

This introduces a new qdoc warning since QtLiteral is a new
namespace without any documentation, but that's for a separate
commit.

Change-Id: I849d5cdde8b64dbbe7e6a526214d422930091cd4
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
This commit is contained in:
Volker Hilsheimer 2021-04-12 13:27:22 +02:00
parent 5b94f88747
commit 3206840b0e
2 changed files with 18 additions and 14 deletions

View File

@ -4767,17 +4767,19 @@ QByteArray QByteArray::toPercentEncoding(const QByteArray &exclude, const QByteA
*/
/*!
\function QtLiterals::operator""_qba(const char *str, size_t size)
\fn QtLiterals::operator""_qba(const char *str, size_t size)
\relates QByteArray
\since 6.2
Literal operator that creates a QByteArray out of a char string literal \a
str. Creating a QByteArray from it is free in this case, and the generated
string data is stored in the read-only segment of the compiled object file.
Duplicate literals may share the same read-only memory. This functionality is
interchangeable with QByteArrayLiteral, but saves typing when many string
literals are present in the code.
Literal operator that creates a QByteArray out of the first \a size characters
in the char string literal \a str.
The QByteArray is created at compile time, and the generated string data is stored
in the read-only segment of the compiled object file. Duplicate literals may share
the same read-only memory. This functionality is interchangeable with
QByteArrayLiteral, but saves typing when many string literals are present in the
code.
The following code creates a QByteArray:
\code

View File

@ -10506,17 +10506,19 @@ QString QString::toHtmlEscaped() const
*/
/*!
\function QtLiterals::operator""_qs(const char16_t *str, size_t size)
\fn QtLiterals::operator""_qs(const char16_t *str, size_t size)
\relates QString
\since 6.2
Literal operator that creates a QString out of a char16_t string literal \a
str. Creating a QString from it is free in this case, and the generated string
data is stored in the read-only segment of the compiled object file. Duplicate
literals may share the same read-only memory. This functionality is
interchangeable with QStringLiteral, but saves typing when many string
literals are present in the code.
Literal operator that creates a QString out of the first \a size characters in
the char16_t string literal \a str.
The QString is created at compile time, and the generated string data is stored
in the read-only segment of the compiled object file. Duplicate literals may
share the same read-only memory. This functionality is interchangeable with
QStringLiteral, but saves typing when many string literals are present in the
code.
The following code creates a QString:
\code