From: Gerhard Sittig Date: Sat, 29 Oct 2022 19:37:21 +0000 (+0200) Subject: viewport: event->position() isn't Qt 5.12, tweak version check X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a7988e20ee451ccc81f43635af41c3bff1ccc783;p=pulseview.git viewport: event->position() isn't Qt 5.12, tweak version check According to https://doc.qt.io/qt-5/qwheelevent.html#position the QWheelEvent::position() method was introduced in Qt 5.14. Adjust the Qt version check to unbreak builds with Qt 5.12. --- diff --git a/pv/views/trace/viewport.cpp b/pv/views/trace/viewport.cpp index 7ab24ead..ff3a47db 100644 --- a/pv/views/trace/viewport.cpp +++ b/pv/views/trace/viewport.cpp @@ -249,7 +249,7 @@ void Viewport::wheelEvent(QWheelEvent *event) - delta * view_.scale() + view_.offset()); } else { // Vertical scrolling is interpreted as zooming in/out -#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) view_.zoom(delta / 120.0, event->position().x()); #else view_.zoom(delta / 120.0, event->x());