diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-05-11 05:56:42 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-05-11 05:56:42 (GMT) |
commit | 7f22443b3cb6cd56a906dbb6edb0c2f7a1314887 (patch) | |
tree | 225963a06f48e31a926b0addc7d9a87f8ac9230a | |
parent | 7e71c79bd6dcc1c8608ebb0570b455372f5f7eaf (diff) | |
download | Qt-7f22443b3cb6cd56a906dbb6edb0c2f7a1314887.zip Qt-7f22443b3cb6cd56a906dbb6edb0c2f7a1314887.tar.gz Qt-7f22443b3cb6cd56a906dbb6edb0c2f7a1314887.tar.bz2 |
Fix double-click AND flicking.
Re-do of dae02071a9e985b3ea847f08af6849ff2daad3c3
-rw-r--r-- | src/declarative/canvas/qsimplecanvas_graphicsview.cpp | 1 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 4 |
2 files changed, 4 insertions, 1 deletions
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: |