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/windowgeometry/controllerwidget.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/windowgeometry/controllerwidget.cpp')
-rw-r--r-- | tests/manual/windowgeometry/controllerwidget.cpp | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/tests/manual/windowgeometry/controllerwidget.cpp b/tests/manual/windowgeometry/controllerwidget.cpp index 0bf089e934..b2b5810158 100644 --- a/tests/manual/windowgeometry/controllerwidget.cpp +++ b/tests/manual/windowgeometry/controllerwidget.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. @@ -29,17 +29,13 @@ #include "controllerwidget.h" #include <controls.h> -#if QT_VERSION >= 0x050000 -# include <QtWidgets> -# include <QWindow> -# include <QBackingStore> -# include <QPaintDevice> -# include <QPainter> -#else -# include <QtGui> -#endif +#include <QtWidgets> +#include <QBackingStore> +#include <QPaintDevice> +#include <QPainter> #include <QResizeEvent> +#include <QWindow> CoordinateControl::CoordinateControl(const QString &sep) : m_x(new QSpinBox), m_y(new QSpinBox) { @@ -291,8 +287,6 @@ void WidgetWindowControl::statesChanged() w->setWindowState(m_statesControl->states()); } -#if QT_VERSION >= 0x050000 - // Test window drawing diagonal lines class Window : public QWindow { @@ -388,14 +382,10 @@ void WindowControl::stateChanged() w->setWindowStates(m_statesControl->states()); } -#endif - ControllerWidget::ControllerWidget(QWidget *parent) : QMainWindow(parent) , m_testWidget(new QWidget) -#if QT_VERSION >= 0x050000 , m_testWindow(new Window) -#endif { QMenu *fileMenu = menuBar()->addMenu(tr("File")); QAction *exitAction = fileMenu->addAction(tr("Exit")); @@ -404,10 +394,8 @@ ControllerWidget::ControllerWidget(QWidget *parent) QString title = QLatin1String("Geometry test, (Qt "); title += QLatin1String(QT_VERSION_STR); -#if QT_VERSION >= 0x050000 title += QLatin1String(", "); title += qApp->platformName(); -#endif title += QLatin1Char(')'); setWindowTitle(title); @@ -417,9 +405,6 @@ ControllerWidget::ControllerWidget(QWidget *parent) const int offsetArgIndex = args.indexOf(QLatin1String("-offset")); if (offsetArgIndex >=0 && offsetArgIndex < args.size() - 1) { y += args.at(offsetArgIndex + 1).toInt(); - } else { - if (QT_VERSION < 0x050000) - y += 400; } move(x, y); @@ -443,7 +428,6 @@ ControllerWidget::ControllerWidget(QWidget *parent) else m_testWidget->show(); -#if QT_VERSION >= 0x050000 x += 300; m_testWindow->setFlags(Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint @@ -459,7 +443,6 @@ ControllerWidget::ControllerWidget(QWidget *parent) else m_testWindow->show(); m_testWindow->setTitle(tr("TestWindow")); -#endif QWidget *central = new QWidget ; QVBoxLayout *l = new QVBoxLayout(central); @@ -478,11 +461,9 @@ ControllerWidget::ControllerWidget(QWidget *parent) widgetControl->refresh(); l->addWidget(widgetControl); -#if QT_VERSION >= 0x050000 BaseWindowControl *windowControl = new WindowControl(m_testWindow.data()); windowControl->refresh(); l->addWidget(windowControl); -#endif setCentralWidget(central); } |