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/diaglib/qwidgetdump.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/diaglib/qwidgetdump.cpp')
-rw-r--r-- | tests/manual/diaglib/qwidgetdump.cpp | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/tests/manual/diaglib/qwidgetdump.cpp b/tests/manual/diaglib/qwidgetdump.cpp index b1d2a37d0e..95c4b175d8 100644 --- a/tests/manual/diaglib/qwidgetdump.cpp +++ b/tests/manual/diaglib/qwidgetdump.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. @@ -28,14 +28,13 @@ #include "qwidgetdump.h" -#include <QWidget> -#if QT_VERSION > 0x050000 -# include <QtGui/QScreen> -# include <QtGui/QWindow> -#endif #include <QApplication> -#include <QtCore/QMetaObject> +#include <QWidget> +#include <QtGui/QScreen> +#include <QtGui/QWindow> + #include <QtCore/QDebug> +#include <QtCore/QMetaObject> #include <QtCore/QTextStream> namespace QtDiag { @@ -99,11 +98,9 @@ static void dumpWidgetRecursion(QTextStream &str, const QWidget *w, formatRect(str, w->geometry()); if (w->isWindow()) { str << ' ' << w->logicalDpiX() << "DPI"; -#if QT_VERSION > 0x050600 const qreal dpr = w->devicePixelRatio(); if (!qFuzzyCompare(dpr, qreal(1))) str << " dpr=" << dpr; -#endif // Qt 5.6 const QRect normalGeometry = w->normalGeometry(); if (normalGeometry.isValid() && !normalGeometry.isEmpty() && normalGeometry != w->geometry()) { str << " normal="; @@ -130,13 +127,11 @@ static void dumpWidgetRecursion(QTextStream &str, const QWidget *w, str << "maximumSize=" << maximumSize.width() << 'x' << maximumSize.height() << ' '; } str << '\n'; -#if QT_VERSION > 0x050000 if (const QWindow *win = w->windowHandle()) { indentStream(str, 2 * (1 + depth)); formatWindow(str, win, options); str << '\n'; } -#endif // Qt 5 for (const QObject *co : w->children()) { if (co->isWidgetType()) dumpWidgetRecursion(str, static_cast<const QWidget *>(co), options, depth + 1); @@ -155,14 +150,8 @@ void dumpAllWidgets(FormatWindowOptions options, const QWidget *root) topLevels = QApplication::topLevelWidgets(); for (QWidget *tw : qAsConst(topLevels)) dumpWidgetRecursion(str, tw, options); -#if QT_VERSION >= 0x050400 - { - for (const QString &line : d.split(QLatin1Char('\n'))) - qDebug().noquote() << line; - } -#else - qDebug("%s", qPrintable(d)); -#endif + for (const QString &line : d.split(QLatin1Char('\n'))) + qDebug().noquote() << line; } } // namespace QtDiag |