diff --git a/src/waveform/widgets/allshader/waveformwidget.cpp b/src/waveform/widgets/allshader/waveformwidget.cpp index 37d67addaa2..76e38834a5b 100644 --- a/src/waveform/widgets/allshader/waveformwidget.cpp +++ b/src/waveform/widgets/allshader/waveformwidget.cpp @@ -1,5 +1,7 @@ #include "waveform/widgets/allshader/waveformwidget.h" +#include + #include "moc_waveformwidget.cpp" #include "waveform/renderers/allshader/waveformrendererabstract.h" @@ -52,3 +54,8 @@ void WaveformWidget::resizeGL(int w, int h) { renderer->allshaderWaveformRenderer()->resizeGL(w, h); } } + +void WaveformWidget::wheelEvent(QWheelEvent* event) { + QApplication::sendEvent(parentWidget(), event); + event->accept(); +} diff --git a/src/waveform/widgets/allshader/waveformwidget.h b/src/waveform/widgets/allshader/waveformwidget.h index 656df919981..1924f448d6a 100644 --- a/src/waveform/widgets/allshader/waveformwidget.h +++ b/src/waveform/widgets/allshader/waveformwidget.h @@ -26,4 +26,5 @@ class allshader::WaveformWidget : public ::WGLWidget, } private: + void wheelEvent(QWheelEvent* event) override; }; diff --git a/src/waveform/widgets/glwaveformwidgetabstract.cpp b/src/waveform/widgets/glwaveformwidgetabstract.cpp index 42b991faf02..ed7610a9060 100644 --- a/src/waveform/widgets/glwaveformwidgetabstract.cpp +++ b/src/waveform/widgets/glwaveformwidgetabstract.cpp @@ -1,6 +1,13 @@ #include "waveform/widgets/glwaveformwidgetabstract.h" +#include + GLWaveformWidgetAbstract::GLWaveformWidgetAbstract(const QString& group, QWidget* parent) : WaveformWidgetAbstract(group), WGLWidget(parent) { } + +void GLWaveformWidgetAbstract::wheelEvent(QWheelEvent* event) { + QApplication::sendEvent(parentWidget(), event); + event->accept(); +} diff --git a/src/waveform/widgets/glwaveformwidgetabstract.h b/src/waveform/widgets/glwaveformwidgetabstract.h index b361c05bab1..7724c3394a1 100644 --- a/src/waveform/widgets/glwaveformwidgetabstract.h +++ b/src/waveform/widgets/glwaveformwidgetabstract.h @@ -41,4 +41,7 @@ class GLWaveformWidgetAbstract : public WaveformWidgetAbstract, public WGLWidget } #endif // !defined(QT_NO_OPENGL) && !defined(QT_OPENGL_ES_2) + + private: + void wheelEvent(QWheelEvent* event) override; }; diff --git a/src/widget/wwaveformviewer.cpp b/src/widget/wwaveformviewer.cpp index 93c5f9d6e9e..a9ae7a65baf 100644 --- a/src/widget/wwaveformviewer.cpp +++ b/src/widget/wwaveformviewer.cpp @@ -187,7 +187,7 @@ void WWaveformViewer::wheelEvent(QWheelEvent* event) { if (m_waveformWidget) { if (event->angleDelta().y() > 0) { onZoomChange(m_waveformWidget->getZoomFactor() / 1.05); - } else { + } else if (event->angleDelta().y() < 0) { onZoomChange(m_waveformWidget->getZoomFactor() * 1.05); } }