summaryrefslogtreecommitdiffstats
path: root/src/gui/graphicsview
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2009-06-26 09:22:03 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2009-06-26 09:22:03 (GMT)
commit272bc3c63ea31e4e5b3c9d8c06f123bc04d90d5a (patch)
treef07031165708a382ab4e8c3662f7e31922a001a4 /src/gui/graphicsview
parent0bbd4db2eed7092c58c36867033fc21d8b86bcd9 (diff)
downloadQt-272bc3c63ea31e4e5b3c9d8c06f123bc04d90d5a.zip
Qt-272bc3c63ea31e4e5b3c9d8c06f123bc04d90d5a.tar.gz
Qt-272bc3c63ea31e4e5b3c9d8c06f123bc04d90d5a.tar.bz2
Don't always send spontaneous events to QGraphicsScene
Only do that if the original event delivered to the QGraphicsView was also spontaneous.
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r--src/gui/graphicsview/qgraphicsview.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp
index ee45690..3f9e823 100644
--- a/src/gui/graphicsview/qgraphicsview.cpp
+++ b/src/gui/graphicsview/qgraphicsview.cpp
@@ -612,7 +612,10 @@ void QGraphicsViewPrivate::mouseMoveEventHandler(QMouseEvent *event)
lastMouseMoveScenePoint = mouseEvent.scenePos();
lastMouseMoveScreenPoint = mouseEvent.screenPos();
mouseEvent.setAccepted(false);
- qt_sendSpontaneousEvent(scene, &mouseEvent);
+ if (event->isSpontaneous())
+ qt_sendSpontaneousEvent(scene, &mouseEvent);
+ else
+ QApplication::sendEvent(scene, &mouseEvent);
// Remember whether the last event was accepted or not.
lastMouseEvent.setAccepted(mouseEvent.isAccepted());
@@ -3025,7 +3028,10 @@ void QGraphicsView::mouseDoubleClickEvent(QMouseEvent *event)
mouseEvent.setAccepted(false);
mouseEvent.setButton(event->button());
mouseEvent.setModifiers(event->modifiers());
- qt_sendSpontaneousEvent(d->scene, &mouseEvent);
+ if (event->isSpontaneous())
+ qt_sendSpontaneousEvent(scene, &mouseEvent);
+ else
+ QApplication::sendEvent(scene, &mouseEvent);
}
/*!
@@ -3064,7 +3070,10 @@ void QGraphicsView::mousePressEvent(QMouseEvent *event)
mouseEvent.setButton(event->button());
mouseEvent.setModifiers(event->modifiers());
mouseEvent.setAccepted(false);
- qt_sendSpontaneousEvent(d->scene, &mouseEvent);
+ if (event->isSpontaneous())
+ qt_sendSpontaneousEvent(scene, &mouseEvent);
+ else
+ QApplication::sendEvent(scene, &mouseEvent);
// Update the original mouse event accepted state.
bool isAccepted = mouseEvent.isAccepted();
@@ -3234,7 +3243,10 @@ void QGraphicsView::mouseReleaseEvent(QMouseEvent *event)
mouseEvent.setButton(event->button());
mouseEvent.setModifiers(event->modifiers());
mouseEvent.setAccepted(false);
- qt_sendSpontaneousEvent(d->scene, &mouseEvent);
+ if (event->isSpontaneous())
+ qt_sendSpontaneousEvent(scene, &mouseEvent);
+ else
+ QApplication::sendEvent(scene, &mouseEvent);
// Update the last mouse event selected state.
d->lastMouseEvent.setAccepted(mouseEvent.isAccepted());
@@ -3365,7 +3377,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event)
// Find all exposed items
bool allItems = false;
QList<QGraphicsItem *> itemList = d->findItems(d->exposedRegion, &allItems);
-
+
if (!itemList.isEmpty()) {
// Generate the style options.
const int numItems = itemList.size();