QGraphicsView - remove not needed storeMouseEvent

updateRubberBand is only called from mouseMoveEvent.
The event is not changed. At the end of the event
we call d->mouseMoveEventHandler which calls
storeMouseEvent. There is no need to call it twice.

Beside that this patch also changes the argument
from QMouseEvent* to const QMouseEvent*. The only
reason it needed to be const was the call to
storeMouseEvent.

Change-Id: I01148a6a8d36e782c4d95a90e36435e20b1681e1
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
This commit is contained in:
Thorbjørn Lund Martsum 2012-12-03 21:49:54 +01:00 committed by The Qt Project
parent 20bde28448
commit 137906da8e
2 changed files with 2 additions and 3 deletions

View File

@ -706,11 +706,10 @@ QRegion QGraphicsViewPrivate::rubberBandRegion(const QWidget *widget, const QRec
return tmp;
}
void QGraphicsViewPrivate::updateRubberBand(QMouseEvent *event)
void QGraphicsViewPrivate::updateRubberBand(const QMouseEvent *event)
{
Q_Q(QGraphicsView);
if (dragMode == QGraphicsView::RubberBandDrag && sceneInteractionAllowed) {
storeMouseEvent(event);
if (rubberBanding) {
// Check for enough drag distance
if ((mousePressViewPoint - event->pos()).manhattanLength()

View File

@ -138,7 +138,7 @@ public:
#ifndef QT_NO_RUBBERBAND
QRect rubberBandRect;
QRegion rubberBandRegion(const QWidget *widget, const QRect &rect) const;
void updateRubberBand(QMouseEvent *event);
void updateRubberBand(const QMouseEvent *event);
bool rubberBanding;
Qt::ItemSelectionMode rubberBandSelectionMode;
#endif