Move to separate headers

Hopefully this can speed up compilation times.
https://doc.qt.io/qt-6/qtglobal.html#details

PR #19430.
This commit is contained in:
Chocobo1 2023-08-11 13:47:55 +08:00 committed by GitHub
parent 9fa48a375d
commit 31fe327763
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 71 additions and 51 deletions

View file

@ -31,6 +31,7 @@
#include <unordered_map>
#include <unordered_set>
#include <QObject>
#include <QTest>
#include "base/algorithm.h"

View file

@ -28,6 +28,7 @@
#include <algorithm>
#include <QObject>
#include <QTest>
#include <QVector>

View file

@ -26,7 +26,10 @@
* exception statement from your version.
*/
#include <QtGlobal>
#include <type_traits>
#include <QList>
#include <QObject>
#include <QTest>
#include "base/global.h"
@ -40,13 +43,27 @@ public:
TestGlobal() = default;
private slots:
#if (QT_VERSION < QT_VERSION_CHECK(6, 4, 0))
void testStringLiteral() const
void testAsConst() const
{
QCOMPARE(u""_s, QStringLiteral(""));
QCOMPARE(u"abc"_s, QStringLiteral("abc"));
{
QList<int> list = {0, 1, 2};
static_assert(std::is_const_v<std::remove_reference_t<decltype(asConst(list))>>);
QCOMPARE(list, asConst(list));
QCOMPARE(list, asConst(QList<int>(list)));
}
{
const QList<int> list = {0, 1, 2};
static_assert(std::is_const_v<std::remove_reference_t<decltype(asConst(list))>>);
QCOMPARE(list, asConst(list));
QCOMPARE(list, asConst(QList<int>(list)));
// should not compile:
//asConst(std::move(list));
}
}
#endif
};
QTEST_APPLESS_MAIN(TestGlobal)

View file

@ -27,6 +27,7 @@
* exception statement from your version.
*/
#include <QObject>
#include <QSet>
#include <QTest>

View file

@ -26,7 +26,8 @@
* exception statement from your version.
*/
#include <QtGlobal>
#include <QtSystemDetection>
#include <QObject>
#include <QTest>
#include "base/global.h"

View file

@ -26,6 +26,7 @@
* exception statement from your version.
*/
#include <QObject>
#include <QTest>
#include "base/global.h"

View file

@ -28,6 +28,7 @@
#include <tuple>
#include <QObject>
#include <QTest>
#include "base/global.h"

View file

@ -26,6 +26,7 @@
* exception statement from your version.
*/
#include <QObject>
#include <QTest>
#include "base/global.h"

View file

@ -26,7 +26,8 @@
* exception statement from your version.
*/
#include <QtGlobal>
#include <QtSystemDetection>
#include <QObject>
#include <QTest>
#include "base/global.h"

View file

@ -26,6 +26,7 @@
* exception statement from your version.
*/
#include <QObject>
#include <QTest>
#include "base/global.h"

View file

@ -26,6 +26,7 @@
* exception statement from your version.
*/
#include <QObject>
#include <QTest>
#include "base/global.h"