summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2022-03-09 22:29:03 +0100
committerSona Kurazyan <sona.kurazyan@qt.io>2022-03-12 01:05:45 +0100
commit28d25144280503cf9131b6f9325d1d7f168af8d9 (patch)
treebf95ae45c4b322e75a69ebe4624bc110deba8251
parentb83fc8aafae72327951c178b3b42ac7bc0d8cefa (diff)
Use qstringfwd.h when forward declaring string classes
Task-number: QTBUG-98434 Change-Id: I37b70a1b7bc164fa7dc9cb702827297ca66a6fdc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/text/qbytearrayview.h4
-rw-r--r--src/corelib/text/qregularexpression.h2
-rw-r--r--src/corelib/text/qutf8stringview.h5
-rw-r--r--src/corelib/tools/qhashfunctions.h4
-rw-r--r--src/testlib/qtestresult_p.h4
5 files changed, 4 insertions, 15 deletions
diff --git a/src/corelib/text/qbytearrayview.h b/src/corelib/text/qbytearrayview.h
index 57d4711fdb..8d3ff0be67 100644
--- a/src/corelib/text/qbytearrayview.h
+++ b/src/corelib/text/qbytearrayview.h
@@ -40,14 +40,12 @@
#define QBYTEARRAYVIEW_H
#include <QtCore/qbytearrayalgorithms.h>
+#include <QtCore/qstringfwd.h>
#include <string>
QT_BEGIN_NAMESPACE
-class QByteArray;
-class QLatin1String;
-
namespace QtPrivate {
template <typename Byte>
diff --git a/src/corelib/text/qregularexpression.h b/src/corelib/text/qregularexpression.h
index 2d81d0c254..b5fee16057 100644
--- a/src/corelib/text/qregularexpression.h
+++ b/src/corelib/text/qregularexpression.h
@@ -54,8 +54,6 @@ QT_REQUIRE_CONFIG(regularexpression);
QT_BEGIN_NAMESPACE
-class QLatin1String;
-
class QRegularExpressionMatch;
class QRegularExpressionMatchIterator;
struct QRegularExpressionPrivate;
diff --git a/src/corelib/text/qutf8stringview.h b/src/corelib/text/qutf8stringview.h
index bec6f96953..76fd86b668 100644
--- a/src/corelib/text/qutf8stringview.h
+++ b/src/corelib/text/qutf8stringview.h
@@ -40,6 +40,7 @@
#define QUTF8STRINGVIEW_H
#include <QtCore/qstringalgorithms.h>
+#include <QtCore/qstringfwd.h>
#include <QtCore/qarraydata.h> // for QContainerImplHelper
#include <QtCore/qbytearrayview.h>
@@ -47,10 +48,6 @@
QT_BEGIN_NAMESPACE
-template <bool> class QBasicUtf8StringView;
-class QByteArray;
-class QLatin1String;
-
namespace QtPrivate {
template <typename Char>
using IsCompatibleChar8TypeHelper = std::disjunction<
diff --git a/src/corelib/tools/qhashfunctions.h b/src/corelib/tools/qhashfunctions.h
index a3e1600600..7aecd2c012 100644
--- a/src/corelib/tools/qhashfunctions.h
+++ b/src/corelib/tools/qhashfunctions.h
@@ -42,6 +42,7 @@
#define QHASHFUNCTIONS_H
#include <QtCore/qstring.h>
+#include <QtCore/qstringfwd.h>
#include <QtCore/qpair.h>
#include <numeric> // for std::accumulate
@@ -60,9 +61,6 @@
QT_BEGIN_NAMESPACE
class QBitArray;
-class QByteArray;
-class QString;
-class QLatin1String;
#if QT_DEPRECATED_SINCE(6,6)
QT_DEPRECATED_VERSION_X_6_6("Use QHashSeed instead")
diff --git a/src/testlib/qtestresult_p.h b/src/testlib/qtestresult_p.h
index 2034c006ad..d4a64e26ab 100644
--- a/src/testlib/qtestresult_p.h
+++ b/src/testlib/qtestresult_p.h
@@ -52,13 +52,11 @@
//
#include <QtTest/qttestglobal.h>
+#include <QtCore/qstringfwd.h>
#include <QtCore/private/qglobal_p.h>
QT_BEGIN_NAMESPACE
-class QLatin1String;
-class QStringView;
-
class QTestResultPrivate;
class QTestData;