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/eventfilter.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/eventfilter.cpp')
-rw-r--r-- | tests/manual/diaglib/eventfilter.cpp | 34 |
1 files changed, 6 insertions, 28 deletions
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; |