Skip to content

Commit

Permalink
PlotView: use QWheelEvent::position when available
Browse files Browse the repository at this point in the history
This fixes a warning about using the deprecated `pos` method
  • Loading branch information
miek committed Oct 16, 2023
1 parent c2566d2 commit 0d07221
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plotview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@ bool PlotView::viewportEvent(QEvent *event) {

// `updateViewRange()` keeps the center sample in the same place after zoom. Apply
// a scroll adjustment to keep the sample under the mouse cursor in the same place instead.
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
zoomPos = wheelEvent->position().x();
#else
zoomPos = wheelEvent->pos().x();
#endif
zoomSample = columnToSample(horizontalScrollBar()->value() + zoomPos);
if (scrollZoomStepsAccumulated >= 120) {
scrollZoomStepsAccumulated -= 120;
Expand Down

0 comments on commit 0d07221

Please sign in to comment.