Fix for both QT4 and QT5

This commit is contained in:
Philippe Teuwen 2020-09-22 00:32:20 +02:00
parent 8bbda87956
commit 6a805eaf33

View file

@ -686,7 +686,11 @@ void Plot::wheelEvent(QWheelEvent *event) {
// 120+shift => zoom out 10%
const float zoom_offset = 0.1;
if (event->modifiers() & Qt::ShiftModifier) {
#if QT_VERSION >= 0x050000
int x = event->position().x();
#else
int x = event->x();
#endif
x -= WIDTH_AXES;
x = (int)(x / GraphPixelsPerPoint);
x += GraphStart;