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 | |
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')
-rw-r--r-- | tests/manual/windowflags/controllerwindow.cpp | 34 | ||||
-rw-r--r-- | tests/manual/windowflags/controls.cpp | 13 | ||||
-rw-r--r-- | tests/manual/windowflags/previewwindow.cpp | 9 |
3 files changed, 8 insertions, 48 deletions
diff --git a/tests/manual/windowflags/controllerwindow.cpp b/tests/manual/windowflags/controllerwindow.cpp index a87844d2cd..ff53a4adb1 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); diff --git a/tests/manual/windowflags/controls.cpp b/tests/manual/windowflags/controls.cpp index 88c9393053..62edeba443 100644 --- a/tests/manual/windowflags/controls.cpp +++ b/tests/manual/windowflags/controls.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 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. @@ -89,9 +89,6 @@ HintControl::HintControl(QWidget *parent) layout->addWidget(windowStaysOnBottomCheckBox, 7, 1); layout->addWidget(customizeWindowHintCheckBox, 5, 0); layout->addWidget(transparentForInputCheckBox, 6, 0); -#if QT_VERSION < 0x050000 - transparentForInputCheckBox->setEnabled(false); -#endif } Qt::WindowFlags HintControl::hints() const @@ -111,10 +108,8 @@ Qt::WindowFlags HintControl::hints() const flags |= Qt::WindowMinimizeButtonHint; if (windowMaximizeButtonCheckBox->isChecked()) flags |= Qt::WindowMaximizeButtonHint; -#if QT_VERSION >= 0x050000 if (windowFullscreenButtonCheckBox->isChecked()) flags |= Qt::WindowFullscreenButtonHint; -#endif if (windowCloseButtonCheckBox->isChecked()) flags |= Qt::WindowCloseButtonHint; if (windowContextHelpButtonCheckBox->isChecked()) @@ -127,10 +122,8 @@ Qt::WindowFlags HintControl::hints() const flags |= Qt::WindowStaysOnBottomHint; if (customizeWindowHintCheckBox->isChecked()) flags |= Qt::CustomizeWindowHint; -#if QT_VERSION >= 0x050000 if (transparentForInputCheckBox->isChecked()) flags |= Qt::WindowTransparentForInput; -#endif return flags; } @@ -143,18 +136,14 @@ void HintControl::setHints(Qt::WindowFlags flags) windowSystemMenuCheckBox->setChecked(flags & Qt::WindowSystemMenuHint); windowMinimizeButtonCheckBox->setChecked(flags & Qt::WindowMinimizeButtonHint); windowMaximizeButtonCheckBox->setChecked(flags & Qt::WindowMaximizeButtonHint); -#if QT_VERSION >= 0x050000 windowFullscreenButtonCheckBox->setChecked(flags & Qt::WindowFullscreenButtonHint); -#endif windowCloseButtonCheckBox->setChecked(flags & Qt::WindowCloseButtonHint); windowContextHelpButtonCheckBox->setChecked(flags & Qt::WindowContextHelpButtonHint); windowShadeButtonCheckBox->setChecked(flags & Qt::WindowShadeButtonHint); windowStaysOnTopCheckBox->setChecked(flags & Qt::WindowStaysOnTopHint); windowStaysOnBottomCheckBox->setChecked(flags & Qt::WindowStaysOnBottomHint); customizeWindowHintCheckBox->setChecked(flags & Qt::CustomizeWindowHint); -#if QT_VERSION >= 0x050000 transparentForInputCheckBox->setChecked(flags & Qt::WindowTransparentForInput); -#endif } void HintControl::slotCheckBoxChanged() diff --git a/tests/manual/windowflags/previewwindow.cpp b/tests/manual/windowflags/previewwindow.cpp index 893dbc9a41..b827d031bf 100644 --- a/tests/manual/windowflags/previewwindow.cpp +++ b/tests/manual/windowflags/previewwindow.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. @@ -79,13 +79,8 @@ static void formatWindowFlags(QTextStream &str, Qt::WindowFlags flags) if (flags & Qt::MSWindowsFixedSizeDialogHint) str << "\n| Qt::MSWindowsFixedSizeDialogHint"; -#if QT_VERSION >= 0x050000 if (flags & Qt::BypassWindowManagerHint) str << "\n| Qt::BypassWindowManagerHint"; -#else - if (flags & Qt::X11BypassWindowManagerHint) - str << "\n| Qt::X11BypassWindowManagerHint"; -#endif if (flags & Qt::FramelessWindowHint) str << "\n| Qt::FramelessWindowHint"; if (flags & Qt::WindowTitleHint) @@ -108,7 +103,6 @@ static void formatWindowFlags(QTextStream &str, Qt::WindowFlags flags) str << "\n| Qt::CustomizeWindowHint"; if (flags & Qt::WindowStaysOnBottomHint) str << "\n| Qt::WindowStaysOnBottomHint"; -#if QT_VERSION >= 0x050000 if (flags & Qt::WindowFullscreenButtonHint) str << "\n| Qt::WindowFullscreenButtonHint"; if (flags & Qt::WindowTransparentForInput) @@ -121,7 +115,6 @@ static void formatWindowFlags(QTextStream &str, Qt::WindowFlags flags) str << "\n| Qt::MaximizeUsingFullscreenGeometryHint"; if (flags & Qt::NoDropShadowWindowHint) str << "\n| Qt::NoDropShadowWindowHint"; -#endif // Qt 5 } static void formatWindowStates(QTextStream &str, Qt::WindowStates states) |