diff options
author | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-07-29 02:51:50 (GMT) |
---|---|---|
committer | Andreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com> | 2009-07-29 03:09:48 (GMT) |
commit | b51f10492b40b94c25661ec42ccf951268f3a969 (patch) | |
tree | 0e8d4f15d1ecf32a8f02cf5ee4f22f922983cd15 /src/gui/graphicsview | |
parent | e841cc37bf7fde58e7b0ffc024d31f6a46a83745 (diff) | |
download | Qt-b51f10492b40b94c25661ec42ccf951268f3a969.zip Qt-b51f10492b40b94c25661ec42ccf951268f3a969.tar.gz Qt-b51f10492b40b94c25661ec42ccf951268f3a969.tar.bz2 |
Ensure hover enter events are dispatched on mouse press.
This change ensures that mouse presses received by the scene when there
are no current mouse grabbers trigger hover event delivery. This is
useful when the scene only receives presses, and no mouse moves (e.g.,
disabling mouse tracking on the viewport, or on systems where the
mouse press is the first received event).
Reviewed-by: Michael Brasser
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index e54efe0..a846cf6 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -3682,6 +3682,13 @@ void QGraphicsScene::keyReleaseEvent(QKeyEvent *keyEvent) void QGraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) { Q_D(QGraphicsScene); + if (d->mouseGrabberItems.isEmpty()) { + // Dispatch hover events + QGraphicsSceneHoverEvent hover; + _q_hoverFromMouseEvent(&hover, mouseEvent); + d->dispatchHoverEvent(&hover); + } + d->mousePressEventHandler(mouseEvent); } |