Skip to content

Commit

Permalink
Fix build for older Qt
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder committed Apr 25, 2022
1 parent f5f4c86 commit eef8886
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Gui/OverlayWidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4449,6 +4449,7 @@ void OverlayManager::Private::interceptEvent(QWidget *widget, QEvent *ev)
case QEvent::Wheel: {
auto we = static_cast<QWheelEvent*>(ev);
QWidget *child = getChildAt(widget, we->globalPos());
#if QT_VERSION >= QT_VERSION_CHECK(5,12,0)
QWheelEvent wheelEvent(child->mapFromGlobal(we->globalPos()),
we->globalPos(),
we->pixelDelta(),
Expand All @@ -4458,6 +4459,19 @@ void OverlayManager::Private::interceptEvent(QWidget *widget, QEvent *ev)
we->phase(),
we->inverted(),
we->source());
#else
QWheelEvent wheelEvent(child->mapFromGlobal(we->globalPos()),
we->globalPos(),
we->pixelDelta(),
we->angleDelta(),
0,
Qt::Vertical,
we->buttons(),
we->modifiers(),
we->phase(),
we->source(),
we->inverted());
#endif
QApplication::sendEvent(child, &wheelEvent);
break;
}
Expand Down

0 comments on commit eef8886

Please sign in to comment.