summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-12-02 17:04:47 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-11 13:37:57 +0100
commit9cf56b3e09114f65f23bb4a8062d632df94b8a04 (patch)
treeee80ded6f062a1339a180d2e7d108f3e199b160c /src/widgets
parentd0a6d6a21516ff8b300ad1181625005b60982f75 (diff)
QGraphicsView - fix rubberband to expand on wheel event
In SHA 51914375b615ddcac711171ac31779fea01b4323 the rubberband selection was fixed, so it followed the scene-point on mousemove. However wheelEvent could move the view - but avoid update of the rubberband (that would not be updated until next mouse-move). This patch fixes that (and generally improves rubberband behavior) since QGraphicsViewPrivate::mouseMoveEventHandler is called by replayLastMouseEvent, which is called from various places, where we need to update the rubberband (e.g scrollContentsBy). Change-Id: I1b78c27edaaecea797a2319086d7a11d437d2bd3 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index 3da202c986..a1ee562807 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -616,6 +616,10 @@ void QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent *event)
{
Q_Q(QGraphicsView);
+#ifndef QT_NO_RUBBERBAND
+ updateRubberBand(event);
+#endif
+
storeMouseEvent(event);
lastMouseEvent.setAccepted(false);
@@ -3263,10 +3267,6 @@ void QGraphicsView::mouseMoveEvent(QMouseEvent *event)
{
Q_D(QGraphicsView);
-#ifndef QT_NO_RUBBERBAND
- d->updateRubberBand(event);
-#endif
-
if (d->dragMode == QGraphicsView::ScrollHandDrag) {
if (d->handScrolling) {
QScrollBar *hBar = horizontalScrollBar();