diff --git a/examples/widgets/widgets/tetrix/tetrixwindow.cpp b/examples/widgets/widgets/tetrix/tetrixwindow.cpp index 5aa5c3f615d..c2e51295225 100644 --- a/examples/widgets/widgets/tetrix/tetrixwindow.cpp +++ b/examples/widgets/widgets/tetrix/tetrixwindow.cpp @@ -89,21 +89,12 @@ TetrixWindow::TetrixWindow(QWidget *parent) //! [4] //! [5] connect(quitButton , &QPushButton::clicked, qApp, &QCoreApplication::quit); connect(pauseButton, &QPushButton::clicked, board, &TetrixBoard::pause); -#if __cplusplus >= 201402L connect(board, &TetrixBoard::scoreChanged, scoreLcd, qOverload(&QLCDNumber::display)); connect(board, &TetrixBoard::levelChanged, levelLcd, qOverload(&QLCDNumber::display)); connect(board, &TetrixBoard::linesRemovedChanged, linesLcd, qOverload(&QLCDNumber::display)); -#else - connect(board, &TetrixBoard::scoreChanged, - scoreLcd, QOverload::of(&QLCDNumber::display)); - connect(board, &TetrixBoard::levelChanged, - levelLcd, QOverload::of(&QLCDNumber::display)); - connect(board, &TetrixBoard::linesRemovedChanged, - linesLcd, QOverload::of(&QLCDNumber::display)); -#endif //! [5] //! [6] diff --git a/src/corelib/kernel/qproperty.h b/src/corelib/kernel/qproperty.h index 356eb43cd3f..4358182c25f 100644 --- a/src/corelib/kernel/qproperty.h +++ b/src/corelib/kernel/qproperty.h @@ -56,7 +56,7 @@ #endif #endif -#if !defined(QT_PROPERTY_COLLECT_BINDING_LOCATION) && __has_include() && __cplusplus >= 201703L && !defined(Q_CLANG_QDOC) +#if !defined(QT_PROPERTY_COLLECT_BINDING_LOCATION) && __has_include() && !defined(Q_CLANG_QDOC) #include #if defined(__cpp_lib_experimental_source_location) #define QT_SOURCE_LOCATION_NAMESPACE std::experimental diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index d8ef892cb74..213368a036b 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -58,7 +58,7 @@ #include #include -#if __has_include() && __cplusplus >= 201703L +#if __has_include() #include #elif defined(Q_CLANG_QDOC) namespace std { template struct variant; } @@ -402,7 +402,7 @@ class Q_CORE_EXPORT QVariant return QVariant(QMetaType::fromType(), std::addressof(value)); } -#if (__has_include() && __cplusplus >= 201703L) || defined(Q_CLANG_QDOC) +#if __has_include() || defined(Q_CLANG_QDOC) template static inline QVariant fromStdVariant(const std::variant &value) { @@ -580,7 +580,7 @@ inline QVariant QVariant::fromValue(const QVariant &value) return value; } -#if __has_include() && __cplusplus >= 201703L +#if __has_include() template<> inline QVariant QVariant::fromValue(const std::monostate &) { diff --git a/src/corelib/text/qstring.h b/src/corelib/text/qstring.h index b2231a239be..b6060530fb9 100644 --- a/src/corelib/text/qstring.h +++ b/src/corelib/text/qstring.h @@ -1466,12 +1466,7 @@ inline std::wstring QString::toStdWString() const { std::wstring str; str.resize(length()); -#if __cplusplus >= 201703L str.resize(toWCharArray(str.data())); -#else - if (length()) - str.resize(toWCharArray(&str.front())); -#endif return str; } diff --git a/src/corelib/text/qstringtokenizer.h b/src/corelib/text/qstringtokenizer.h index 796ba1d8107..d14099ffbbe 100644 --- a/src/corelib/text/qstringtokenizer.h +++ b/src/corelib/text/qstringtokenizer.h @@ -46,9 +46,7 @@ QT_BEGIN_NAMESPACE template class QStringBuilder; -#if defined(Q_QDOC) || 1 || (defined(__cpp_range_based_for) && __cpp_range_based_for >= 201603) -# define Q_STRINGTOKENIZER_USE_SENTINEL -#endif +#define Q_STRINGTOKENIZER_USE_SENTINEL class QStringTokenizerBaseBase { diff --git a/src/corelib/tools/qduplicatetracker_p.h b/src/corelib/tools/qduplicatetracker_p.h index 8d64ee53714..19f69161a63 100644 --- a/src/corelib/tools/qduplicatetracker_p.h +++ b/src/corelib/tools/qduplicatetracker_p.h @@ -52,7 +52,7 @@ #include -#if __has_include() && __cplusplus > 201402L +#if __has_include() # include # include # include // for the hashing helpers diff --git a/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp b/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp index 53c59d51703..cc2bac8e2bf 100644 --- a/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp +++ b/tests/auto/corelib/kernel/qproperty/tst_qproperty.cpp @@ -35,7 +35,7 @@ #if __has_include() && __cplusplus >= 202002L && !defined(Q_CLANG_QDOC) #include #define QT_SOURCE_LOCATION_NAMESPACE std -#elif __has_include() && __cplusplus >= 201703L && !defined(Q_CLANG_QDOC) +#elif __has_include() && !defined(Q_CLANG_QDOC) #include #define QT_SOURCE_LOCATION_NAMESPACE std::experimental #endif diff --git a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp index 5ca08b4e629..40dfb79cff9 100644 --- a/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp +++ b/tests/auto/corelib/kernel/qvariant/tst_qvariant.cpp @@ -48,7 +48,7 @@ #include #include #include -#if __has_include() && __cplusplus >= 201703L +#if __has_include() #include #endif #include @@ -4882,7 +4882,7 @@ void tst_QVariant::shouldDeleteVariantDataWorksForAssociative() void tst_QVariant::fromStdVariant() { -#if __has_include() && __cplusplus >= 201703L +#if __has_include() { typedef std::variant intorbool_t; intorbool_t stdvar = 5; diff --git a/tests/benchmarks/corelib/thread/qreadwritelock/tst_bench_qreadwritelock.cpp b/tests/benchmarks/corelib/thread/qreadwritelock/tst_bench_qreadwritelock.cpp index f0ec45e2670..be12877df19 100644 --- a/tests/benchmarks/corelib/thread/qreadwritelock/tst_bench_qreadwritelock.cpp +++ b/tests/benchmarks/corelib/thread/qreadwritelock/tst_bench_qreadwritelock.cpp @@ -30,10 +30,8 @@ #include #include #if __has_include() -#if __cplusplus > 201103L #include #endif -#endif #include // Wrapers that take pointers instead of reference to have the same interface as Qt