From 137da0326a2988c9e93afd1359ba932bd18d6da0 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 12 Dec 2024 11:55:56 +0100 Subject: [PATCH] QStringView: use qstringfwd.h ... instead of fwd-declaring a bunch of stuff manually. Also move the fake QDoc decalaration of a "class QUtf8StringView" over. Pick-to: 6.8 6.5 Change-Id: I80bc3240d69f69602c127fc0e8fe694dd46765f1 Reviewed-by: Thiago Macieira Reviewed-by: Ivan Solovev (cherry picked from commit 8404c21152ed3e28f8e00d683a494a8e1e25a69a) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/text/qstringfwd.h | 4 +++- src/corelib/text/qstringview.h | 6 +----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/corelib/text/qstringfwd.h b/src/corelib/text/qstringfwd.h index fe5bd4e544e..6d75201f7eb 100644 --- a/src/corelib/text/qstringfwd.h +++ b/src/corelib/text/qstringfwd.h @@ -42,7 +42,9 @@ class QChar; class QRegularExpression; class QRegularExpressionMatch; -#ifndef Q_QDOC +#ifdef Q_QDOC +class QUtf8StringView; +#else // ### Qt 7: remove the non-char8_t version of QUtf8StringView QT_BEGIN_NO_CHAR8_T_NAMESPACE using QUtf8StringView = QBasicUtf8StringView; diff --git a/src/corelib/text/qstringview.h b/src/corelib/text/qstringview.h index 3dcfa3771ab..b050a9aef7c 100644 --- a/src/corelib/text/qstringview.h +++ b/src/corelib/text/qstringview.h @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -22,13 +23,8 @@ Q_FORWARD_DECLARE_OBJC_CLASS(NSString); QT_BEGIN_NAMESPACE -class QString; -class QStringView; class QRegularExpression; class QRegularExpressionMatch; -#ifdef Q_QDOC -class QUtf8StringView; -#endif namespace QtPrivate { template