summaryrefslogtreecommitdiffstats
path: root/tests/manual/diaglib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/diaglib')
-rw-r--r--tests/manual/diaglib/debugproxystyle.cpp26
-rw-r--r--tests/manual/diaglib/eventfilter.cpp34
-rw-r--r--tests/manual/diaglib/glinfo.cpp36
-rw-r--r--tests/manual/diaglib/logwidget.cpp14
-rw-r--r--tests/manual/diaglib/nativewindowdump.cpp11
-rw-r--r--tests/manual/diaglib/nativewindowdump_win.cpp6
-rw-r--r--tests/manual/diaglib/qwidgetdump.cpp27
-rw-r--r--tests/manual/diaglib/qwindowdump.cpp46
-rw-r--r--tests/manual/diaglib/textdump.cpp34
9 files changed, 37 insertions, 197 deletions
diff --git a/tests/manual/diaglib/debugproxystyle.cpp b/tests/manual/diaglib/debugproxystyle.cpp
index 002220507b..cf73ae2ef8 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;
}
diff --git a/tests/manual/diaglib/eventfilter.cpp b/tests/manual/diaglib/eventfilter.cpp
index b99d4099e3..2a434a2cdb 100644
--- a/tests/manual/diaglib/eventfilter.cpp
+++ b/tests/manual/diaglib/eventfilter.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.
@@ -31,17 +31,11 @@
#include <QtCore/QDebug>
#include <QtCore/QTextStream>
-#if QT_VERSION >= 0x050000
-# if defined(QT_WIDGETS_LIB)
-# define HAVE_APPLICATION
-# endif
-# if defined(QT_GUI_LIB)
-# define HAVE_GUI_APPLICATION
-# endif
-#else // Qt 5
-# if defined(QT_GUI_LIB)
-# define HAVE_APPLICATION
-# endif
+#if defined(QT_WIDGETS_LIB)
+# define HAVE_APPLICATION
+#endif
+#if defined(QT_GUI_LIB)
+# define HAVE_GUI_APPLICATION
#endif
#ifdef HAVE_APPLICATION
@@ -82,9 +76,7 @@ void EventFilter::init(EventCategories eventCategories)
m_eventTypes << QEvent::MouseMove << QEvent::NonClientAreaMouseMove;
if (eventCategories & TouchEvents) {
m_eventTypes << QEvent::TouchBegin << QEvent::TouchUpdate << QEvent::TouchEnd;
-#if QT_VERSION >= 0x050000
m_eventTypes << QEvent::TouchCancel;
-#endif
}
if (eventCategories & TabletEvents) {
m_eventTypes << QEvent::TabletEnterProximity << QEvent::TabletLeaveProximity
@@ -100,9 +92,7 @@ void EventFilter::init(EventCategories eventCategories)
}
if (eventCategories & FocusEvents) {
m_eventTypes
-#if QT_VERSION >= 0x050000
<< QEvent::FocusAboutToChange
-#endif
<< QEvent::FocusIn << QEvent::FocusOut;
}
if (eventCategories & GeometryEvents)
@@ -110,17 +100,13 @@ void EventFilter::init(EventCategories eventCategories)
if (eventCategories & PaintEvents) {
m_eventTypes << QEvent::UpdateRequest << QEvent::Paint
<< QEvent::Show << QEvent::Hide;
-#if QT_VERSION >= 0x050000
m_eventTypes << QEvent::Expose;
-#endif
}
if (eventCategories & StateChangeEvents) {
m_eventTypes
<< QEvent::WindowStateChange
<< QEvent::WindowBlocked << QEvent::WindowUnblocked
-#if QT_VERSION >= 0x050000
<< QEvent::ApplicationStateChange
-#endif
<< QEvent::ApplicationActivate << QEvent::ApplicationDeactivate;
}
if (eventCategories & TimerEvents)
@@ -131,9 +117,7 @@ void EventFilter::init(EventCategories eventCategories)
}
if (eventCategories & InputMethodEvents) {
m_eventTypes << QEvent::InputMethod;
-#if QT_VERSION >= 0x050000
m_eventTypes << QEvent::InputMethodQuery;
-#endif
}
#ifndef QT_NO_GESTURES
if (eventCategories & GestureEvents) {
@@ -147,10 +131,8 @@ static inline bool matchesType(const QObject *o, EventFilter::ObjectTypes types)
{
if (o->isWidgetType())
return types & EventFilter::QWidgetType;
-#if QT_VERSION >= 0x050000
if (o->isWindowType())
return types & EventFilter::QWindowType;
-#endif
return types & EventFilter::OtherType;
}
@@ -215,9 +197,7 @@ bool EventFilter::eventFilter(QObject *o, QEvent *e)
formatObject(o, debug);
debug << ' ' << e;
switch (e->type()) {
-#if QT_VERSION >= 0x050000
case QEvent::FocusAboutToChange:
-#endif
case QEvent::FocusIn:
formatApplicationState(debug);
break;
@@ -230,9 +210,7 @@ bool EventFilter::eventFilter(QObject *o, QEvent *e)
case QEvent::NonClientAreaMouseButtonPress:
case QEvent::NonClientAreaMouseButtonRelease:
case QEvent::NonClientAreaMouseMove:
-# if QT_VERSION >= 0x050000
case QEvent::Enter:
-# endif
case QEvent::Leave:
formatMouseState(o, debug);
break;
diff --git a/tests/manual/diaglib/glinfo.cpp b/tests/manual/diaglib/glinfo.cpp
index d8aec5298a..663ceabc05 100644
--- a/tests/manual/diaglib/glinfo.cpp
+++ b/tests/manual/diaglib/glinfo.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.
@@ -30,24 +30,16 @@
#include <QOpenGLFunctions>
#include <QtOpenGLWidgets/QOpenGLWidget>
-#if QT_VERSION > 0x050000
-# if QT_VERSION >= 0x050400
-# include <QtOpenGL/QOpenGLWindow>
-# else // 5.4
-# include <QtGui/QWindow>
-# endif // 5.0..5.4
-# include <QtGui/QOpenGLContext>
-# include <QtGui/QOpenGLFunctions>
-# include <QtGui/QWindow>
-#endif
+#include <QtOpenGL/QOpenGLWindow>
+#include <QtGui/QOpenGLContext>
+#include <QtGui/QOpenGLFunctions>
+#include <QtGui/QWindow>
#include <QtCore/QDebug>
#include <QtCore/QString>
#include <QtCore/QTimer>
namespace QtDiag {
-#if QT_VERSION > 0x050000
-
static QString getGlString(const QOpenGLContext *ctx, GLenum name)
{
if (const GLubyte *p = ctx->functions()->glGetString(name))
@@ -64,7 +56,6 @@ static QString glInfo(const QOpenGLContext *ctx)
QString glInfo(const QObject *o)
{
-# if QT_VERSION >= 0x050400
if (o->isWindowType()) {
if (const QOpenGLWindow *oglw = qobject_cast<const QOpenGLWindow *>(o))
return glInfo(oglw->context());
@@ -74,25 +65,8 @@ QString glInfo(const QObject *o)
if (o->isWidgetType()) {
if (const QOpenGLWidget *g = qobject_cast<const QOpenGLWidget *>(o))
return glInfo(g->context());
-# endif // 5.4
}
return QString();
}
-#else // Qt4:
-
-static QString getGlString(GLenum name)
-{
- if (const GLubyte *p = glGetString(name))
- return QString::fromLatin1(reinterpret_cast<const char *>(p));
- return QString();
-}
-
-QString glInfo(const QObject *)
-{
- return getGlString(GL_VENDOR) + QLatin1Char('\n') + getGlString(GL_RENDERER);
-}
-
-#endif
-
} // namespace QtDiag
diff --git a/tests/manual/diaglib/logwidget.cpp b/tests/manual/diaglib/logwidget.cpp
index 0089664a60..a1822d7ed4 100644
--- a/tests/manual/diaglib/logwidget.cpp
+++ b/tests/manual/diaglib/logwidget.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 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.
@@ -27,15 +27,13 @@
****************************************************************************/
#include "logwidget.h"
-#if QT_VERSION >= 0x050000
-# include <QtCore/qlogging.h>
-# include <QtCore/QLibraryInfo>
-#endif
#include <QApplication>
#include <QStyle>
#include <QtCore/QDebug>
+#include <QtCore/QLibraryInfo>
#include <QtCore/QList>
+#include <QtCore/qlogging.h>
#include <QtCore/QStringList>
#include <iostream>
@@ -60,19 +58,13 @@ LogWidget::~LogWidget()
QString LogWidget::startupMessage()
{
QString result;
-#if QT_VERSION >= 0x050300
result += QLatin1String(QLibraryInfo::build());
-#else
- result += QLatin1String("Qt ") + QLatin1String(QT_VERSION_STR);
-#endif
const QCoreApplication *coreApp = QCoreApplication::instance();
-#if QT_VERSION >= 0x050000
if (qobject_cast<const QGuiApplication *>(coreApp)) {
result += QLatin1Char(' ');
result += QGuiApplication::platformName();
}
-#endif
if (qobject_cast<const QApplication *>(coreApp)) {
result += QLatin1Char(' ');
result += QApplication::style()->objectName();
diff --git a/tests/manual/diaglib/nativewindowdump.cpp b/tests/manual/diaglib/nativewindowdump.cpp
index a854e8a790..2937665bad 100644
--- a/tests/manual/diaglib/nativewindowdump.cpp
+++ b/tests/manual/diaglib/nativewindowdump.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.
@@ -28,25 +28,20 @@
#include "nativewindowdump.h"
-#if QT_VERSION >= 0x050000
-# include <QtGui/QGuiApplication>
-# include <qpa/qplatformnativeinterface.h>
-#endif
-
+#include <QtGui/QGuiApplication>
+#include <qpa/qplatformnativeinterface.h>
#include <QtCore/QDebug>
namespace QtDiag {
void dumpNativeWindows(WId wid)
{
-#if QT_VERSION >= 0x050000
QPlatformNativeInterface *ni = QGuiApplication::platformNativeInterface();
QString result;
QMetaObject::invokeMethod(ni, "dumpNativeWindows", Qt::DirectConnection,
Q_RETURN_ARG(QString, result),
Q_ARG(WId, wid));
qDebug().noquote() << result;
-#endif // Qt 5
}
void dumpNativeQtTopLevels()
diff --git a/tests/manual/diaglib/nativewindowdump_win.cpp b/tests/manual/diaglib/nativewindowdump_win.cpp
index 8fbd634937..f88b189665 100644
--- a/tests/manual/diaglib/nativewindowdump_win.cpp
+++ b/tests/manual/diaglib/nativewindowdump_win.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.
@@ -262,11 +262,7 @@ static void dumpNativeWindows(const WIdVector& wins)
dc.stream = QSharedPointer<QTextStream>(new QTextStream(&s));
for (WId win : wins)
dumpNativeWindowRecursion(reinterpret_cast<HWND>(win), &dc);
-#if QT_VERSION >= 0x050400
qDebug().noquote() << s;
-#else
- qDebug("%s", qPrintable(s));
-#endif
}
void dumpNativeWindows(WId rootIn)
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
diff --git a/tests/manual/diaglib/qwindowdump.cpp b/tests/manual/diaglib/qwindowdump.cpp
index 1e46f62b1d..2e5b3e0f96 100644
--- a/tests/manual/diaglib/qwindowdump.cpp
+++ b/tests/manual/diaglib/qwindowdump.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,21 +28,18 @@
#include "qwindowdump.h"
-#if QT_VERSION > 0x050000
-# include <QtGui/QGuiApplication>
-# include <QtGui/QScreen>
-# include <QtGui/QWindow>
-# include <qpa/qplatformwindow.h>
-# include <private/qwindow_p.h>
-# if QT_VERSION >= 0x050600
-# include <private/qhighdpiscaling_p.h>
-# endif
-#endif
+#include <QtGui/QGuiApplication>
+#include <QtGui/QScreen>
+#include <QtGui/QWindow>
+#include <QtCore/QDebug>
#include <QtCore/QMetaObject>
#include <QtCore/QRect>
-#include <QtCore/QDebug>
#include <QtCore/QTextStream>
+#include <qpa/qplatformwindow.h>
+#include <private/qwindow_p.h>
+#include <private/qhighdpiscaling_p.h>
+
namespace QtDiag {
void indentStream(QTextStream &s, int indent)
@@ -87,10 +84,8 @@ void formatWindowFlags(QTextStream &str, Qt::WindowFlags flags)
debugType(str, windowType, Qt::SplashScreen)
debugType(str, windowType, Qt::Desktop)
debugType(str, windowType, Qt::SubWindow)
-#if QT_VERSION > 0x050000
debugType(str, windowType, Qt::ForeignWindow)
debugType(str, windowType, Qt::CoverWindow)
-#endif
debugFlag(str, flags, Qt::MSWindowsFixedSizeDialogHint)
debugFlag(str, flags, Qt::MSWindowsOwnDC)
debugFlag(str, flags, Qt::X11BypassWindowManagerHint)
@@ -103,20 +98,16 @@ void formatWindowFlags(QTextStream &str, Qt::WindowFlags flags)
debugFlag(str, flags, Qt::WindowShadeButtonHint)
debugFlag(str, flags, Qt::WindowStaysOnTopHint)
debugFlag(str, flags, Qt::CustomizeWindowHint)
-#if QT_VERSION > 0x050000
debugFlag(str, flags, Qt::WindowTransparentForInput)
debugFlag(str, flags, Qt::WindowOverridesSystemGestures)
debugFlag(str, flags, Qt::WindowDoesNotAcceptFocus)
debugFlag(str, flags, Qt::NoDropShadowWindowHint)
debugFlag(str, flags, Qt::WindowFullscreenButtonHint)
-#endif
debugFlag(str, flags, Qt::WindowStaysOnBottomHint)
debugFlag(str, flags, Qt::MacWindowToolBarButtonHint)
debugFlag(str, flags, Qt::BypassGraphicsProxyWidget)
}
-#if QT_VERSION > 0x050000
-
void formatWindow(QTextStream &str, const QWindow *w, FormatWindowOptions options)
{
const QPlatformWindow *pw = w->handle();
@@ -137,10 +128,8 @@ void formatWindow(QTextStream &str, const QWindow *w, FormatWindowOptions option
formatRect(str, w->geometry());
if (w->isTopLevel()) {
str << " \"" << w->screen()->name() << "\" ";
-#if QT_VERSION >= 0x050600
if (QHighDpiScaling::isActive())
str << "factor=" << QHighDpiScaling::factor(w) << " dpr=" << w->devicePixelRatio();
-#endif
}
if (!(options & DontPrintWindowFlags)) {
str << ' ';
@@ -176,24 +165,7 @@ void dumpAllWindows(FormatWindowOptions options)
str << "### QWindows:\n";
for (QWindow *w : QGuiApplication::topLevelWindows())
dumpWindowRecursion(str, w, options);
-#if QT_VERSION >= 0x050400
qDebug().noquote() << d;
-#else
- qDebug() << d;
-#endif
}
-#else // Qt 5
-class QWindow {};
-
-void formatWindow(QTextStream &, const QWindow *, FormatWindowOptions)
-{
-}
-
-void dumpAllWindows(FormatWindowOptions options)
-{
-}
-
-#endif // Qt 4
-
} // namespace QtDiag
diff --git a/tests/manual/diaglib/textdump.cpp b/tests/manual/diaglib/textdump.cpp
index 54a251928a..544f094fd1 100644
--- a/tests/manual/diaglib/textdump.cpp
+++ b/tests/manual/diaglib/textdump.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.
@@ -41,28 +41,20 @@ struct EnumLookup {
static const EnumLookup specialCharactersEnumLookup[] =
{
{QChar::Null, "Null"},
-#if QT_VERSION >= 0x050000
{QChar::Tabulation, "Tabulation"},
{QChar::LineFeed, "LineFeed"},
-# if QT_VERSION >= 0x050e00
{QChar::FormFeed, "FormFeed"},
-# endif
{QChar::CarriageReturn, "CarriageReturn"},
{QChar::Space, "Space"},
-#endif
{QChar::Nbsp, "Nbsp"},
-#if QT_VERSION >= 0x050000
{QChar::SoftHyphen, "SoftHyphen"},
-#endif
{QChar::ReplacementCharacter, "ReplacementCharacter"},
{QChar::ObjectReplacementCharacter, "ObjectReplacementCharacter"},
{QChar::ByteOrderMark, "ByteOrderMark"},
{QChar::ByteOrderSwapped, "ByteOrderSwapped"},
{QChar::ParagraphSeparator, "ParagraphSeparator"},
{QChar::LineSeparator, "LineSeparator"},
-#if QT_VERSION >= 0x050000
{QChar::LastValidCodePoint, "LastValidCodePoint"}
-#endif
};
static const EnumLookup categoryEnumLookup[] =
@@ -105,8 +97,6 @@ static const EnumLookup categoryEnumLookup[] =
{QChar::Symbol_Other, "Symbol_Other"},
};
-#if QT_VERSION >= 0x050100
-
static const EnumLookup scriptEnumLookup[] =
{
{QChar::Script_Unknown, "Script_Unknown"},
@@ -221,7 +211,6 @@ static const EnumLookup scriptEnumLookup[] =
{QChar::Script_SoraSompeng, "Script_SoraSompeng"},
{QChar::Script_Takri, "Script_Takri"},
-#if QT_VERSION >= 0x050500
{QChar::Script_CaucasianAlbanian, "Script_CaucasianAlbanian"},
{QChar::Script_BassaVah, "Script_BassaVah"},
{QChar::Script_Duployan, "Script_Duployan"},
@@ -245,20 +234,15 @@ static const EnumLookup scriptEnumLookup[] =
{QChar::Script_Khudawadi, "Script_Khudawadi"},
{QChar::Script_Tirhuta, "Script_Tirhuta"},
{QChar::Script_WarangCiti, "Script_WarangCiti"},
-#endif // Qt 5.5
-#if QT_VERSION >= 0x050600
{QChar::Script_Ahom, "Script_Ahom"},
{QChar::Script_AnatolianHieroglyphs, "Script_AnatolianHieroglyphs"},
{QChar::Script_Hatran, "Script_Hatran"},
{QChar::Script_Multani, "Script_Multani"},
{QChar::Script_OldHungarian, "Script_OldHungarian"},
{QChar::Script_SignWriting, "Script_SignWriting"},
-#endif // Qt 5.5
};
-#endif // Qt 5.1
-
static const EnumLookup directionEnumLookup[] =
{
{QChar::DirL, "DirL"},
@@ -280,12 +264,10 @@ static const EnumLookup directionEnumLookup[] =
{QChar::DirPDF, "DirPDF"},
{QChar::DirNSM, "DirNSM"},
{QChar::DirBN, "DirBN"},
-#if QT_VERSION >= 0x050000
{QChar::DirLRI, "DirLRI"},
{QChar::DirRLI, "DirRLI"},
{QChar::DirFSI, "DirFSI"},
{QChar::DirPDI, "DirPDI"},
-#endif
};
static const EnumLookup decompositionEnumLookup[] =
@@ -310,8 +292,6 @@ static const EnumLookup decompositionEnumLookup[] =
{QChar::Fraction, "Fraction"},
};
-#if QT_VERSION >= 0x050000
-
static const EnumLookup joiningTypeEnumLookup[] =
{
{QChar::Joining_None, "Joining_None"},
@@ -322,8 +302,6 @@ static const EnumLookup joiningTypeEnumLookup[] =
{QChar::Joining_Transparent, "Joining_Transparent"}
};
-#endif // Qt 5
-
static const EnumLookup combiningClassEnumLookup[] =
{
{QChar::Combining_BelowLeftAttached, "Combining_BelowLeftAttached"},
@@ -361,20 +339,14 @@ static const EnumLookup unicodeVersionEnumLookup[] =
{QChar::Unicode_4_0, "Unicode_4_0"},
{QChar::Unicode_4_1, "Unicode_4_1"},
{QChar::Unicode_5_0, "Unicode_5_0"},
-#if QT_VERSION >= 0x050000
{QChar::Unicode_5_1, "Unicode_5_1"},
{QChar::Unicode_5_2, "Unicode_5_2"},
{QChar::Unicode_6_0, "Unicode_6_0"},
{QChar::Unicode_6_1, "Unicode_6_1"},
{QChar::Unicode_6_2, "Unicode_6_2"},
{QChar::Unicode_6_3, "Unicode_6_3"},
-#if QT_VERSION >= 0x050500
{QChar::Unicode_7_0, "Unicode_7_0"},
-#endif // Qt 5.5
-#if QT_VERSION >= 0x050600
{QChar::Unicode_8_0, "Unicode_8_0"},
-#endif // Qt 5.6
-#endif // Qt 5
};
static const EnumLookup *enumLookup(int v, const EnumLookup *array, size_t size)
@@ -423,7 +395,6 @@ static void formatCharacter(QTextStream &str, const QChar &qc, FormattingContext
<< enumName(category, categoryEnumLookup, sizeof(categoryEnumLookup) / sizeof(EnumLookup));
context.category = category;
}
-#if QT_VERSION >= 0x050100
const int script = qc.script();
if (script != context.script) {
str << " script="
@@ -431,21 +402,18 @@ static void formatCharacter(QTextStream &str, const QChar &qc, FormattingContext
<< '(' << script << ')';
context.script = script;
}
-#endif // Qt 5
const int direction = qc.direction();
if (direction != context.direction) {
str << " direction="
<< enumName(direction, directionEnumLookup, sizeof(directionEnumLookup) / sizeof(EnumLookup));
context.direction = direction;
}
-#if QT_VERSION >= 0x050000
const int joiningType = qc.joiningType();
if (joiningType != context.joiningType) {
str << " joiningType="
<< enumName(joiningType, joiningTypeEnumLookup, sizeof(joiningTypeEnumLookup) / sizeof(EnumLookup));
context.joiningType = joiningType;
}
-#endif // Qt 5QWidget
const int decompositionTag = qc.decompositionTag();
if (decompositionTag != context.decompositionTag) {
str << " decomposition="