Skip to content

Commit

Permalink
Remove support for Qt6 versions less than 6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen Winter committed Jan 2, 2024
1 parent 1feb378 commit 3d22a17
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 27 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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)
--------------------------
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 1 addition & 14 deletions common/remoteviewinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ QDataStream &operator<<(QDataStream &s, const QList<QTouchEvent::TouchPoint> &po
return s;
}

#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0)
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
template<class T, class TouchPoint>
void setPointValue(QDataStream &s, TouchPoint &p, void (TouchPoint::*func)(T))
{
Expand All @@ -136,11 +136,7 @@ QDataStream &operator>>(QDataStream &s, QList<QTouchEvent::TouchPoint> &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);
Expand All @@ -160,18 +156,10 @@ QDataStream &operator>>(QDataStream &s, QList<QTouchEvent::TouchPoint> &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);
}
Expand Down Expand Up @@ -212,7 +200,6 @@ QDataStream &operator>>(QDataStream &s, QList<QTouchEvent::TouchPoint> &points)

QT_END_NAMESPACE


RemoteViewInterface::RemoteViewInterface(const QString &name, QObject *parent)
: QObject(parent)
, m_name(name)
Expand Down
4 changes: 2 additions & 2 deletions plugins/quickinspector/quickinspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ 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)
F(NoBatching
#endif
#undef F

Expand Down
10 changes: 0 additions & 10 deletions ui/remoteviewwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand All @@ -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
Expand Down

0 comments on commit 3d22a17

Please sign in to comment.