# HG changeset patch # User Chris Cannam # Date 1481905793 0 # Node ID 808d375a3b12281f78b6253ba325f8b189106762 # Parent 73d43e410a6b78d5ec029f29a3d912142046617a Support mouse wheel on level-pan tool button diff -r 73d43e410a6b -r 808d375a3b12 widgets/LevelPanToolButton.cpp --- a/widgets/LevelPanToolButton.cpp Fri Dec 16 15:55:59 2016 +0000 +++ b/widgets/LevelPanToolButton.cpp Fri Dec 16 16:29:53 2016 +0000 @@ -59,6 +59,12 @@ { } +void +LevelPanToolButton::wheelEvent(QWheelEvent *e) +{ + m_lpw->wheelEvent(e); +} + float LevelPanToolButton::getLevel() const { diff -r 73d43e410a6b -r 808d375a3b12 widgets/LevelPanToolButton.h --- a/widgets/LevelPanToolButton.h Fri Dec 16 15:55:59 2016 +0000 +++ b/widgets/LevelPanToolButton.h Fri Dec 16 16:29:53 2016 +0000 @@ -70,6 +70,7 @@ virtual void paintEvent(QPaintEvent *); virtual void enterEvent(QEvent *); virtual void leaveEvent(QEvent *); + virtual void wheelEvent(QWheelEvent *e); LevelPanWidget *m_lpw; int m_pixels; diff -r 73d43e410a6b -r 808d375a3b12 widgets/LevelPanWidget.h --- a/widgets/LevelPanWidget.h Fri Dec 16 15:55:59 2016 +0000 +++ b/widgets/LevelPanWidget.h Fri Dec 16 16:29:53 2016 +0000 @@ -62,6 +62,9 @@ /// Specify whether the level range should include muting or not void setIncludeMute(bool); + // public so it can be called from LevelPanToolButton (ew) + virtual void wheelEvent(QWheelEvent *ev); + signals: void levelChanged(float); // range [0,1] void panChanged(float); // range [-1,1] @@ -73,7 +76,6 @@ virtual void mousePressEvent(QMouseEvent *ev); virtual void mouseMoveEvent(QMouseEvent *ev); virtual void mouseReleaseEvent(QMouseEvent *ev); - virtual void wheelEvent(QWheelEvent *ev); virtual void paintEvent(QPaintEvent *ev); virtual void enterEvent(QEvent *); virtual void leaveEvent(QEvent *);