Skip to content

Commit

Permalink
Gui: Target proper widget when passing wheel event
Browse files Browse the repository at this point in the history
  • Loading branch information
kadet1090 authored and adrianinsaval committed Oct 16, 2023
1 parent a34896a commit de030e8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Gui/OverlayManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1947,6 +1947,13 @@ void OverlayManager::Private::interceptEvent(QWidget *widget, QEvent *ev)
QPoint globalPos = we->globalPosition().toPoint();
#endif
lastIntercept = getChildAt(widget, globalPos);

for (auto parent = lastIntercept->parentWidget(); parent; parent = parent->parentWidget()) {
if (qobject_cast<QGraphicsView*>(parent)) {
lastIntercept = parent;
}
}

#if QT_VERSION >= QT_VERSION_CHECK(5,12,0)
QWheelEvent wheelEvent(lastIntercept->mapFromGlobal(globalPos),
globalPos,
Expand Down

0 comments on commit de030e8

Please sign in to comment.