From 3206840b0e7d6895285122872fa0e7dc038e4865 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 12 Apr 2021 13:27:22 +0200 Subject: [PATCH] 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 Reviewed-by: Andrei Golubev Reviewed-by: Nico Vertriest --- src/corelib/text/qbytearray.cpp | 16 +++++++++------- src/corelib/text/qstring.cpp | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index 677fc6d6ac..3a0f28f444 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -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 diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 3455daa3ca..a690aac936 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -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