From 7f22443b3cb6cd56a906dbb6edb0c2f7a1314887 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Mon, 11 May 2009 15:56:42 +1000 Subject: Fix double-click AND flicking. Re-do of dae02071a9e985b3ea847f08af6849ff2daad3c3 --- src/declarative/canvas/qsimplecanvas_graphicsview.cpp | 1 + src/gui/graphicsview/qgraphicsscene.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/declarative/canvas/qsimplecanvas_graphicsview.cpp b/src/declarative/canvas/qsimplecanvas_graphicsview.cpp index 5c6f2f5..dd4012b 100644 --- a/src/declarative/canvas/qsimplecanvas_graphicsview.cpp +++ b/src/declarative/canvas/qsimplecanvas_graphicsview.cpp @@ -110,6 +110,7 @@ void QSimpleGraphicsItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) p = p->parent(); } owner->mouseReleaseEvent(event); + ungrabMouse(); } void QSimpleGraphicsItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 69e08d1..bc5c091 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -1329,7 +1329,9 @@ void QGraphicsScenePrivate::mousePressEventHandler(QGraphicsSceneMouseEvent *mou // check if the item we are sending to are disabled (before we send the event) bool disabled = !item->isEnabled(); bool isWindow = item->isWindow(); - if (mouseEvent->type() == QEvent::GraphicsSceneMouseDoubleClick && item != lastMouseGrabberItem) { + if (mouseEvent->type() == QEvent::GraphicsSceneMouseDoubleClick + && item != lastMouseGrabberItem && lastMouseGrabberItem) + { // If this item is different from the item that received the last // mouse event, and mouseEvent is a doubleclick event, then the // event is converted to a press. Known limitation: -- cgit v0.12