From b96d3752e30d0556b812ce0f620738e18ee467ea Mon Sep 17 00:00:00 2001 From: Mike Krus Date: Fri, 20 Nov 2020 17:03:16 +0000 Subject: Handle API changes for event handling QMouseEvent position getter is different between 5.15 and 6 Change-Id: I45fd7a1350624f725bd35c5ea33f7da75d8f31a1 Reviewed-by: Paul Lemire --- src/input/frontend/qmouseevent.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/input/frontend') diff --git a/src/input/frontend/qmouseevent.h b/src/input/frontend/qmouseevent.h index 809c71ec5..884cec1d6 100644 --- a/src/input/frontend/qmouseevent.h +++ b/src/input/frontend/qmouseevent.h @@ -85,8 +85,13 @@ public: explicit QMouseEvent(const QT_PREPEND_NAMESPACE(QMouseEvent) &e); ~QMouseEvent(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) inline int x() const { return int(m_event->position().x()); } inline int y() const { return int(m_event->position().y()); } +#else + inline int x() const { return int(m_event->x()); } + inline int y() const { return int(m_event->y()); } +#endif inline bool wasHeld() const { #if QT_CONFIG(gestures) return static_cast(m_event->type()) == Qt::TapAndHoldGesture; -- cgit v1.2.3