summaryrefslogtreecommitdiffstats
path: root/tests/manual/diaglib/debugproxystyle.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <[email protected]>2021-09-17 16:07:10 +0200
committerEdward Welbourne <[email protected]>2021-09-23 16:57:03 +0200
commit298e41b830f60c0f2f078996ace77a4254a9f335 (patch)
tree4bf6029da36fb143aeeb11c04a2bdf442ef56b42 /tests/manual/diaglib/debugproxystyle.cpp
parente5d65996a93bbf4cbc8a155887def6efa3ad73de (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 <[email protected]>
Diffstat (limited to 'tests/manual/diaglib/debugproxystyle.cpp')
-rw-r--r--tests/manual/diaglib/debugproxystyle.cpp26
1 files changed, 1 insertions, 25 deletions
diff --git a/tests/manual/diaglib/debugproxystyle.cpp b/tests/manual/diaglib/debugproxystyle.cpp
index 002220507b2..cf73ae2ef86 100644
--- a/tests/manual/diaglib/debugproxystyle.cpp
+++ b/tests/manual/diaglib/debugproxystyle.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.
@@ -34,37 +34,21 @@
#include <QStyleOption>
#include <QApplication>
-#if QT_VERSION < 0x050000
-QDebug operator<<(QDebug d, const QPixmap &p)
-{
- d << "QPixmap(" << p.size() << ')';
- return d;
-}
-#endif // QT_VERSION < 0x050000
-
QDebug operator<<(QDebug debug, const QStyleOption *option)
{
-#if QT_VERSION >= 0x050000
QDebugStateSaver saver(debug);
-# if QT_VERSION >= 0x050400
debug.noquote();
-# endif
debug.nospace();
-#endif
if (!option) {
debug << "QStyleOption(0)";
return debug;
}
if (const QStyleOptionViewItem *ivo = qstyleoption_cast<const QStyleOptionViewItem *>(option)) {
debug << "QStyleOptionViewItem(";
-#if QT_VERSION >= 0x050000
debug << ivo->index;
if (const int textSize = ivo->text.size())
debug << ", \"" << (textSize < 20 ? ivo->text : ivo->text.left(20) + QLatin1String("...")) << '"';
debug << ", ";
-#else // Qt 5
- Q_UNUSED(ivo);
-#endif
} else {
debug << "QStyleOption(";
}
@@ -72,10 +56,8 @@ QDebug operator<<(QDebug debug, const QStyleOption *option)
<< option->rect.x() << option->rect.y() << Qt::noforcesign;
if (option->state != QStyle::State_None)
debug << ", state=" << option->state;
-#if QT_VERSION >= 0x050000
if (option->styleObject && !option->styleObject->isWidgetType())
debug << ", styleObject=" << QtDiag::formatQObject(option->styleObject);
-#endif
debug << ')';
return debug;
}
@@ -84,15 +66,9 @@ namespace QtDiag {
DebugProxyStyle::DebugProxyStyle(QStyle *style) : QProxyStyle(style)
{
-#if QT_VERSION >= 0x050000
const qreal devicePixelRatio = qApp->devicePixelRatio();
-#else
- const qreal devicePixelRatio = 1;
-#endif
qDebug() << __FUNCTION__ << QT_VERSION_STR
-#if QT_VERSION >= 0x050000
<< QGuiApplication::platformName()
-#endif
<< style->objectName() << "devicePixelRatio=" << devicePixelRatio;
}