diff --git a/gb.qt4/src/CWidget.cpp b/gb.qt4/src/CWidget.cpp index fd0057ce7..d7281bd39 100644 --- a/gb.qt4/src/CWidget.cpp +++ b/gb.qt4/src/CWidget.cpp @@ -3118,18 +3118,20 @@ bool CWidget::eventFilter(QObject *widget, QEvent *event) { MOUSE_info.orientation = Qt::Horizontal; MOUSE_info.delta = delta.x(); + cancel = GB.Raise(control, EVENT_MouseWheel, 0); } - else + if (delta.y()) { MOUSE_info.orientation = Qt::Vertical; MOUSE_info.delta = delta.y(); + cancel = GB.Raise(control, EVENT_MouseWheel, 0); } #else MOUSE_info.orientation = ev->orientation(); MOUSE_info.delta = ev->delta(); + cancel = GB.Raise(control, EVENT_MouseWheel, 0); #endif - cancel = GB.Raise(control, EVENT_MouseWheel, 0); CMOUSE_clear(false); diff --git a/gb.qt4/src/ctrayicon.cpp b/gb.qt4/src/ctrayicon.cpp index 693e3daaa..bcffb84d0 100644 --- a/gb.qt4/src/ctrayicon.cpp +++ b/gb.qt4/src/ctrayicon.cpp @@ -389,10 +389,17 @@ bool TrayIconManager::eventFilter(QObject *o, QEvent *e) CTRAYICON *_object = find_trayicon(o); if (THIS) { - bool cancel; + bool cancel = true; QWheelEvent *ev = (QWheelEvent *)e; +#ifdef QT5 + if (ev->angleDelta().x()) + cancel = GB.Raise(THIS, EVENT_Scroll, 2, GB_T_FLOAT, ev->angleDelta().x() / 120.0, GB_T_INTEGER, false); + if (ev->angleDelta().y()) + cancel = GB.Raise(THIS, EVENT_Scroll, 2, GB_T_FLOAT, ev->angleDelta().y() / 120.0, GB_T_INTEGER, true); +#else cancel = GB.Raise(THIS, EVENT_Scroll, 2, GB_T_FLOAT, ev->delta() / 120.0, GB_T_INTEGER, ev->orientation() == Qt::Vertical); +#endif if (cancel) return true;