File tree Expand file tree Collapse file tree
src/OpenCOVER/plugins/general/WindowTypeQt Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -462,19 +462,26 @@ void QtOsgWidget::wheelEvent(QWheelEvent *event)
462462 setKeyboardModifiers (event);
463463 event->accept ();
464464#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
465- osgGA::GUIEventAdapter::ScrollingMotion motion =
466- event->angleDelta ().y ()>0 ? osgGA::GUIEventAdapter::SCROLL_UP : osgGA::GUIEventAdapter::SCROLL_DOWN ;
467- if (event->angleDelta ().x () != 0 )
468- motion = motion = event->angleDelta ().x () >0 ? osgGA::GUIEventAdapter::SCROLL_LEFT : osgGA::GUIEventAdapter::SCROLL_RIGHT ;
469-
465+ if (event->angleDelta ().y () != 0 )
466+ {
467+ auto motion =
468+ event->angleDelta ().y () > 0 ? osgGA::GUIEventAdapter::SCROLL_UP : osgGA::GUIEventAdapter::SCROLL_DOWN ;
469+ getEventQueue ()->mouseScroll (motion);
470+ }
471+ else if (event->angleDelta ().x () != 0 )
472+ {
473+ auto motion =
474+ event->angleDelta ().x () > 0 ? osgGA::GUIEventAdapter::SCROLL_LEFT : osgGA::GUIEventAdapter::SCROLL_RIGHT ;
475+ getEventQueue ()->mouseScroll (motion);
476+ }
470477#else
471478 int delta = event->delta ();
472479 osgGA::GUIEventAdapter::ScrollingMotion motion =
473480 delta>0 ? osgGA::GUIEventAdapter::SCROLL_UP : osgGA::GUIEventAdapter::SCROLL_DOWN ;
474481 if (event->orientation () == Qt::Horizontal)
475- motion = delta>0 ? osgGA::GUIEventAdapter::SCROLL_LEFT : osgGA::GUIEventAdapter::SCROLL_RIGHT ;
476- #endif
482+ motion = delta > 0 ? osgGA::GUIEventAdapter::SCROLL_LEFT : osgGA::GUIEventAdapter::SCROLL_RIGHT ;
477483 getEventQueue ()->mouseScroll (motion);
484+ #endif
478485}
479486
480487osgGA::EventQueue* QtOsgWidget::getEventQueue () const
You can’t perform that action at this time.
0 commit comments