From: Till T. <ro...@tt...> - 2012-04-07 20:08:06
|
Git commit 7de1fe2c10a6bd6ea27eb4d9716f36c0ff760a27 by Till Theato. Committed on 07/04/2012 at 22:06. Pushed by theato into branch 'master'. Allow to scroll in MonitorScene using the mouse wheel. M +10 -1 src/monitorscene.cpp http://commits.kde.org/kdenlive/7de1fe2c10a6bd6ea27eb4d9716f36c0ff760a27 diff --git a/src/monitorscene.cpp b/src/monitorscene.cpp index 089e5e9..8970d82 100644 --- a/src/monitorscene.cpp +++ b/src/monitorscene.cpp @@ -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(); |