]> git.sesse.net Git - kdenlive/commitdiff
Allow to scroll in MonitorScene using the mouse wheel.
authorTill Theato <root@ttill.de>
Sat, 7 Apr 2012 20:06:34 +0000 (22:06 +0200)
committerTill Theato <root@ttill.de>
Sat, 7 Apr 2012 20:06:34 +0000 (22:06 +0200)
src/monitorscene.cpp

index 089e5e96f1be0c15f9eef27cdfd63122d749767e..8970d82a5a28345c4c23f4e1800ebb56e299df3e 100644 (file)
@@ -27,6 +27,7 @@
 #include <QGraphicsView>
 #include <QGraphicsPixmapItem>
 #include <QGraphicsSceneMouseEvent>
+#include <QScrollBar>
 
 
 MonitorScene::MonitorScene(Render *renderer, QObject* parent) :
@@ -250,7 +251,15 @@ void MonitorScene::wheelEvent(QGraphicsSceneWheelEvent* event)
             slotZoomOut(5);
         }
     } else {
-        QGraphicsScene::wheelEvent(event);
+        QAbstractSlider::SliderAction action;
+        if (event->delta() > 0)
+            action = QAbstractSlider::SliderSingleStepSub;
+        else
+            action = QAbstractSlider::SliderSingleStepAdd;
+        if (event->orientation() == Qt::Horizontal)
+            m_view->horizontalScrollBar()->triggerAction(action);
+        else
+            m_view->verticalScrollBar()->triggerAction(action);
     }
 
     event->accept();