Switch plotview to QGraphicsView for canvas dragging

This commit is contained in:
Mike Walters
2017-04-14 20:06:35 +01:00
parent 509c4ea320
commit f4e98a389b
2 changed files with 4 additions and 3 deletions

View File

@@ -36,6 +36,7 @@
PlotView::PlotView(InputSource *input) : cursors(this), viewRange({0, 0})
{
mainSampleSource = input;
setDragMode(QGraphicsView::ScrollHandDrag);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
setMouseTracking(true);
enableCursors(false);
@@ -193,7 +194,7 @@ bool PlotView::viewportEvent(QEvent *event) {
}
// Handle parent eveents
QAbstractScrollArea::viewportEvent(event);
QGraphicsView::viewportEvent(event);
// Pass mouse events to individual plot objects
if (event->type() == QEvent::MouseButtonPress ||