diff options
| author | Edward Welbourne <edward.welbourne@qt.io> | 2021-09-17 16:07:10 +0200 |
|---|---|---|
| committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-09-23 16:57:03 +0200 |
| commit | 298e41b830f60c0f2f078996ace77a4254a9f335 (patch) | |
| tree | 4bf6029da36fb143aeeb11c04a2bdf442ef56b42 /tests/manual/windowflags/controllerwindow.cpp | |
| parent | e5d65996a93bbf4cbc8a155887def6efa3ad73de (diff) | |
Remove fatuously true or false QT_VERSION checks
QT_VERSION is now at least QT_VERSION_CHECK(6, 3, 0), so remove all
checks against Qt 6.0.0 or earlier. They are superfluous. Tidied up in
some places in the process, particularly #include order.
Change-Id: I2636b2fd13be5b976f5b043ef2f8cddc038a72a4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/manual/windowflags/controllerwindow.cpp')
| -rw-r--r-- | tests/manual/windowflags/controllerwindow.cpp | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/tests/manual/windowflags/controllerwindow.cpp b/tests/manual/windowflags/controllerwindow.cpp index a87844d2cd2..ff53a4adb16 100644 --- a/tests/manual/windowflags/controllerwindow.cpp +++ b/tests/manual/windowflags/controllerwindow.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the test suite of the Qt Toolkit. @@ -32,23 +32,19 @@ #include <QAction> #include <QApplication> #include <QCheckBox> +#include <QDebug> #include <QGroupBox> #include <QHBoxLayout> #include <QLabel> +#include <QLibraryInfo> +#include <qlogging.h> #include <QMainWindow> #include <QMenu> +#include <QMoveEvent> #include <QPushButton> #include <QRadioButton> #include <QTabWidget> - -#include <QMoveEvent> - -#if QT_VERSION >= 0x050000 -# include <QWindow> -# include <qlogging.h> -# include <QLibraryInfo> -#endif -#include <QDebug> +#include <QWindow> ControllerWidget::ControllerWidget(QWidget *parent) : QWidget(parent) @@ -224,10 +220,8 @@ static bool isTopLevel(const QObject *o) { if (o->isWidgetType()) return static_cast<const QWidget *>(o)->isWindow(); -#if QT_VERSION >= 0x050000 if (o->isWindowType()) return static_cast<const QWindow *>(o)->isTopLevel(); -#endif return false; } @@ -238,10 +232,8 @@ static Qt::WindowStates windowState(const QObject *o) states &= ~Qt::WindowActive; return states; } -#if QT_VERSION >= 0x050000 if (o->isWindowType()) return static_cast<const QWindow *>(o)->windowState(); -#endif return Qt::WindowNoState; } @@ -257,9 +249,7 @@ public: case QEvent::WindowStateChange: case QEvent::ApplicationActivate: case QEvent::ApplicationDeactivate: -#if QT_VERSION >= 0x050000 case QEvent::ApplicationStateChange: -#endif if (isTopLevel(o)) formatEvent(o, e); break; @@ -274,9 +264,7 @@ private: { static int n = 0; QDebug debug = qDebug().nospace(); -#if QT_VERSION >= 0x050000 debug.noquote(); -#endif debug << '#' << n++ << ' ' << o->metaObject()->className(); const QString name = o->objectName(); if (!name.isEmpty()) @@ -320,15 +308,9 @@ void LogWidget::install() QString LogWidget::startupMessage() { QString result; -#if QT_VERSION >= 0x050300 result += QLatin1String(QLibraryInfo::build()); -#else - result += QLatin1String("Qt ") + QLatin1String(QT_VERSION_STR); -#endif -#if QT_VERSION >= 0x050000 result += QLatin1Char(' '); result += QGuiApplication::platformName(); -#endif return result; } @@ -342,11 +324,7 @@ ControllerWindow::ControllerWindow() { setWindowTitle(tr("Window Flags (Qt version %1, %2)") .arg(QLatin1String(qVersion()), -#if QT_VERSION >= 0x050000 qApp->platformName())); -#else - QLatin1String("<unknown>"))); -#endif QVBoxLayout *layout = new QVBoxLayout(this); QTabWidget *tabWidget = new QTabWidget(this); |
