doc: Add missing fromArray() documentation

QAnyStringView::fromArray() was not documented, leading to a broken
auto-link that referred to it.

Change-Id: Ibf3704da8b3f16e56589bd649ce1e63a7cbd3739
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f9334be98e4deb9e9a4a30f5f22e92b571670938)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 25107519e5ec527fddcbda53b0634522802d3aaa)
bb10
David Boddie 2025-02-11 16:34:10 +01:00 committed by Qt Cherry-pick Bot
parent 4e9414c2bb
commit 01671eabc2
1 changed files with 19 additions and 0 deletions

View File

@ -697,4 +697,23 @@ QDebug operator<<(QDebug d, QAnyStringView s)
}
/*!
\fn template <typename Char, size_t Size, QAnyStringView::if_compatible_char<Char>> QAnyStringView QAnyStringView::fromArray(const Char (&string)[Size])
Constructs a string view on the full character string literal \a string,
including any trailing \c{Char(0)}. If you don't want the
null-terminator included in the view then you can chop() it off
when you are certain it is at the end. Alternatively you can use
the constructor overload taking an array literal which will create
a view up to, but not including, the first null-terminator in the data.
\a string must remain valid for the lifetime of this string view
object.
This function will work with any array literal if \c Char is a
compatible character type. The compatible character types are: \c QChar, \c ushort, \c
char16_t and (on platforms, such as Windows, where it is a 16-bit
type) \c wchar_t.
*/
QT_END_NAMESPACE