doc: Add missing fromArray() documentation

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

Pick-to: 6.8
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>
This commit is contained in:
David Boddie 2025-02-11 16:34:10 +01:00 committed by Qt Cherry-pick Bot
parent 8014b45a7a
commit 25107519e5

View File

@ -705,4 +705,23 @@ QDebug operator<<(QDebug d, QAnyStringView s)
\sa QString::arg(Args&&...) \sa QString::arg(Args&&...)
*/ */
/*!
\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 QT_END_NAMESPACE