diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-10-26 12:00:43 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2010-10-26 12:00:43 (GMT) |
commit | 85f3f3ac74a2e7fe6a0874a46f9358a15f0dab34 (patch) | |
tree | 191b227596f18333f1609ff824d2746dd7f1090f /src/gui/graphicsview/qgraphicsscene.cpp | |
parent | 26139fcacc05b4a74fce1ef4e0db819118765310 (diff) | |
parent | 2d071521228a6bc9ef423cbdbbd8560d28208790 (diff) | |
download | Qt-85f3f3ac74a2e7fe6a0874a46f9358a15f0dab34.zip Qt-85f3f3ac74a2e7fe6a0874a46f9358a15f0dab34.tar.gz Qt-85f3f3ac74a2e7fe6a0874a46f9358a15f0dab34.tar.bz2 |
Merge remote branch 'qt/master' into lighthouse-master
Conflicts:
src/opengl/qwindowsurface_gl.cpp
Diffstat (limited to 'src/gui/graphicsview/qgraphicsscene.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 5b1da9e..981fbbc 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -3461,7 +3461,8 @@ bool QGraphicsScene::event(QEvent *event) break; } case QEvent::Leave: - d->leaveScene(); + // hackieshly unpacking the viewport pointer from the leave event. + d->leaveScene(reinterpret_cast<QWidget *>(event->d)); break; case QEvent::GraphicsSceneHelp: helpEvent(static_cast<QGraphicsSceneHelpEvent *>(event)); @@ -3933,20 +3934,19 @@ bool QGraphicsScenePrivate::dispatchHoverEvent(QGraphicsSceneHoverEvent *hoverEv Handles all actions necessary to clean up the scene when the mouse leaves the view. */ -void QGraphicsScenePrivate::leaveScene() +void QGraphicsScenePrivate::leaveScene(QWidget *viewport) { - Q_Q(QGraphicsScene); #ifndef QT_NO_TOOLTIP QToolTip::hideText(); #endif + QGraphicsView *view = qobject_cast<QGraphicsView *>(viewport->parent()); // Send HoverLeave events to all existing hover items, topmost first. - QGraphicsView *senderWidget = qobject_cast<QGraphicsView *>(q->sender()); QGraphicsSceneHoverEvent hoverEvent; - hoverEvent.setWidget(senderWidget); + hoverEvent.setWidget(viewport); - if (senderWidget) { + if (view) { QPoint cursorPos = QCursor::pos(); - hoverEvent.setScenePos(senderWidget->mapToScene(senderWidget->mapFromGlobal(cursorPos))); + hoverEvent.setScenePos(view->mapToScene(viewport->mapFromGlobal(cursorPos))); hoverEvent.setLastScenePos(hoverEvent.scenePos()); hoverEvent.setScreenPos(cursorPos); hoverEvent.setLastScreenPos(hoverEvent.screenPos()); |