diff options
author | Mike Krus <mike.krus@kdab.com> | 2020-11-20 17:03:16 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2020-12-01 09:29:29 +0000 |
commit | b96d3752e30d0556b812ce0f620738e18ee467ea (patch) | |
tree | 7ed464e0bdd91a46583781cb89c36bc162b69767 /src/input/frontend | |
parent | 4e248d8d0229f8afa283e9e9fe57f54a92bf4477 (diff) |
Handle API changes for event handling
QMouseEvent position getter is different between 5.15 and 6
Change-Id: I45fd7a1350624f725bd35c5ea33f7da75d8f31a1
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/input/frontend')
-rw-r--r-- | src/input/frontend/qmouseevent.h | 5 |
1 files changed, 5 insertions, 0 deletions
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<Qt::GestureType>(m_event->type()) == Qt::TapAndHoldGesture; |