mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-05 20:51:25 -07:00
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:
parent
9fa48a375d
commit
31fe327763
52 changed files with 71 additions and 51 deletions
|
@ -31,6 +31,7 @@
|
|||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/algorithm.h"
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
#include <QVector>
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
#include <QTest>
|
||||
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/global.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/global.h"
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include <tuple>
|
||||
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/global.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/global.h"
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QtSystemDetection>
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/global.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/global.h"
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
* exception statement from your version.
|
||||
*/
|
||||
|
||||
#include <QObject>
|
||||
#include <QTest>
|
||||
|
||||
#include "base/global.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue