changeset 1200:808d375a3b12 levelpanwidget

Support mouse wheel on level-pan tool button
author Chris Cannam
date Fri, 16 Dec 2016 16:29:53 +0000
parents 73d43e410a6b
children a68c25ba1153
files widgets/LevelPanToolButton.cpp widgets/LevelPanToolButton.h widgets/LevelPanWidget.h
diffstat 3 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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
 {
--- 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;
--- 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 *);