diff --git a/include/Utils/qtSimple.h b/include/Utils/qtSimple.h index aae270a16ded2570326fa91d22e04d907cab4afd..a67559a84b5d9c464d8b4617442232438e057281 100644 --- a/include/Utils/qtSimple.h +++ b/include/Utils/qtSimple.h @@ -291,6 +291,11 @@ public: */ virtual void cb_mouseMove(int button, int x, int y) {} + /** + * the mouse has been move (with button still pressed) + */ + virtual void cb_wheelEvent(int delta, int x, int y) {} + /** * key press CB (context is ok) */ @@ -365,7 +370,6 @@ public: */ std::string selectFileSave(const std::string& title = "open file", const std::string& dir = ".", const std::string& filters = "all (*.*)"); - public slots: virtual void cb_New() { std::cerr << "callback not implemented" << std::endl; } virtual void cb_Open() { std::cerr << "callback not implemented" << std::endl; } diff --git a/src/Utils/qtgl.cpp b/src/Utils/qtgl.cpp index 5eaf2f8d5844f8925de6d7be6e6d52967e9bcbb7..095db9aa610019f5030dc60990c09f519e28dc20 100644 --- a/src/Utils/qtgl.cpp +++ b/src/Utils/qtgl.cpp @@ -241,6 +241,9 @@ void GLWidget::wheelEvent(QWheelEvent* event) newModel = 1; updateGL(); + + if (m_cbs) + m_cbs->cb_wheelEvent(event->delta(), event->x(), getHeight() - event->y()); } void GLWidget::keyPressEvent(QKeyEvent* event)