Skip to content

Commit

Permalink
viewport: event->position() isn't Qt 5.12, tweak version check
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gsigh committed Nov 21, 2022
1 parent 18a155c commit a7988e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pv/views/trace/viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit a7988e2

Please sign in to comment.