From 7a5c69b40470a2e3144bfd187641c99f89319c33 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Tue, 2 Jan 2024 08:44:25 -0500 Subject: [PATCH] Remove support for Qt6 versions less than 6.3 --- CHANGES | 1 + CMakeLists.txt | 4 ++++ INSTALL.md | 2 +- common/remoteviewinterface.cpp | 15 +-------------- plugins/quickinspector/quickinspector.cpp | 2 +- ui/remoteviewwidget.cpp | 10 ---------- 6 files changed, 8 insertions(+), 26 deletions(-) diff --git a/CHANGES b/CHANGES index aabe5b1af7..f3841d29e9 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,7 @@ Release Highlights Version 3.1.0 (unreleased) -------------------------- * Qt5 versions less than 5.15 are no longer supported + * Qt6 versions less that 6.3 are no longer supported Version 3.0.1 (unreleased) -------------------------- diff --git a/CMakeLists.txt b/CMakeLists.txt index 29c3cdd3a9..5d865e114f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -441,6 +441,10 @@ endif() set_package_properties(Qt${QT_VERSION_MAJOR}Core PROPERTIES TYPE REQUIRED) find_package(Qt${QT_VERSION_MAJOR} NO_MODULE REQUIRED COMPONENTS Gui Network) +if(QT_VERSION_MAJOR EQUAL 6 AND QT_VERSION_MINOR LESS 3) + message(FATAL_ERROR "Sorry, Qt6 less than version 6.3 is not supported since GammaRay 3.1") +endif() + find_package( Qt${QT_VERSION_MAJOR} NO_MODULE QUIET OPTIONAL_COMPONENTS diff --git a/INSTALL.md b/INSTALL.md index 575bb50c6c..9b6ec765ef 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -9,7 +9,7 @@ To build GammaRay you will need *at least*: - CMake 3.16.0 - a C++ compiler with C++11 support -- Qt 5.15 or higher, or Qt 6 +- Qt 5.15 or higher, or Qt 6.3 or higher (GammaRay v3.0.0 was the last release to support Qt versions less than 5.15) Please be aware that GammaRay heavily relies on Qt private headers which can diff --git a/common/remoteviewinterface.cpp b/common/remoteviewinterface.cpp index 19b734cfcd..da18ec3ecd 100644 --- a/common/remoteviewinterface.cpp +++ b/common/remoteviewinterface.cpp @@ -110,7 +110,7 @@ QDataStream &operator<<(QDataStream &s, const QList &po return s; } -#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) template void setPointValue(QDataStream &s, TouchPoint &p, void (TouchPoint::*func)(T)) { @@ -136,11 +136,7 @@ QDataStream &operator>>(QDataStream &s, QList &points) #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) for (int i = 0; i < count; ++i) { -#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0) - QMutableEventPoint p; -#else QEventPoint p; -#endif setPointValue(s, p, &QMutableEventPoint::setId); setPointValue(s, p, &QMutableEventPoint::setState); @@ -160,18 +156,10 @@ QDataStream &operator>>(QDataStream &s, QList &points) quint64 v; s >> v; -#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0) - p.setPressTimestamp(v); -#else QMutableEventPoint::setPressTimestamp(p, v); -#endif s >> v; -#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0) - p.setTimestamp(v); -#else QMutableEventPoint::setTimestamp(p, v); -#endif points.append(p); } @@ -212,7 +200,6 @@ QDataStream &operator>>(QDataStream &s, QList &points) QT_END_NAMESPACE - RemoteViewInterface::RemoteViewInterface(const QString &name, QObject *parent) : QObject(parent) , m_name(name) diff --git a/plugins/quickinspector/quickinspector.cpp b/plugins/quickinspector/quickinspector.cpp index c32cc5ee24..24b5955224 100644 --- a/plugins/quickinspector/quickinspector.cpp +++ b/plugins/quickinspector/quickinspector.cpp @@ -188,7 +188,7 @@ static QString qsgMaterialFlagsToString(QSGMaterial::Flags flags) F(RequiresDeterminant) F(RequiresFullMatrixExceptTranslate) F(RequiresFullMatrix) -#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0) +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) F(CustomCompileStep) #else F(NoBatching) diff --git a/ui/remoteviewwidget.cpp b/ui/remoteviewwidget.cpp index 38c9f2203d..2ebd6aed16 100644 --- a/ui/remoteviewwidget.cpp +++ b/ui/remoteviewwidget.cpp @@ -887,15 +887,9 @@ QTouchEvent::TouchPoint RemoteViewWidget::mapToSource(const QTouchEvent::TouchPo #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) -#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0) - QMutableEventPoint mut = QMutableEventPoint::constFrom(point); -#define SET_POINT_VALUE(func, value) \ - mut.func(value) -#else QMutableEventPoint::update(point, p); #define SET_POINT_VALUE(func, val) \ QMutableEventPoint::func(p, (val)) -#endif SET_POINT_VALUE(setScenePosition, mapToSource(point.scenePos())); SET_POINT_VALUE(setGlobalGrabPosition, mapToSource(point.globalGrabPosition())); @@ -915,10 +909,6 @@ QTouchEvent::TouchPoint RemoteViewWidget::mapToSource(const QTouchEvent::TouchPo SET_POINT_VALUE(setPressTimestamp, point.pressTimestamp()); SET_POINT_VALUE(setEllipseDiameters, point.ellipseDiameters()); -#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0) - p = mut; -#endif - #undef SET_POINT_VALUE #else