summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-11-28 14:47:34 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-01 08:28:43 +0100
commit51914375b615ddcac711171ac31779fea01b4323 (patch)
tree9b90483be27836ad99798d62b14dbb8770ad381b /src/widgets
parent1b95d3331cb43fda36f92189ddce4e4c45bd47ea (diff)
QGraphicsView - fix rubberband to stay right on scroll
We should consider the scene-position when we are expanding moving a rubberband. If the user does some auto-scroll (Qt should support that itself, but that is another matter) then the rubberband should not keep the (old) local position to calculate the rubberband extension, but instead use the scene-position that was actually clicked. Change-Id: I04a2df6a1edae8b3587e1ac2104c7fe4ccfb7762 Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index 5c338367f9..2012f980db 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -3238,7 +3238,7 @@ void QGraphicsView::mouseMoveEvent(QMouseEvent *event)
}
// Update rubberband position
- const QPoint &mp = d->mousePressViewPoint;
+ const QPoint &mp = mapFromScene(d->mousePressScenePoint);
QPoint ep = event->pos();
d->rubberBandRect = QRect(qMin(mp.x(), ep.x()), qMin(mp.y(), ep.y()),
qAbs(mp.x() - ep.x()) + 1, qAbs(mp.y() - ep.y()) + 1);