]> sigrok.org Git - pulseview.git/commitdiff
viewport: event->position() isn't Qt 5.12, tweak version check
authorGerhard Sittig <redacted>
Sat, 29 Oct 2022 19:37:21 +0000 (21:37 +0200)
committerGerhard Sittig <redacted>
Mon, 21 Nov 2022 12:36:06 +0000 (13:36 +0100)
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.

pv/views/trace/viewport.cpp

index 7ab24eadd3ffd9bd4f8edd30679d8cde0de74f08..ff3a47db25ef25601c9213b3e6d5dfab87da98fb 100644 (file)
@@ -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());