Do not send double click when neither mouse nor touch was accepted
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>
Wed, 9 May 2012 06:44:59 +0000 (09:44 +0300)
committerQt by Nokia <qt-info@nokia.com>
Thu, 10 May 2012 07:10:55 +0000 (09:10 +0200)
The original fix in change Ief4de360203e55e56f83179075e050f717a12108
worked fine for mouse-based components. However when mixing with
components that handle touch too, the event->isAccepted() condition
gets problematic: It might be true because the touch was accepted, it
does not guarantee the mouse press was accepted.

Change-Id: I00bfff2bd700da84f8cc12cf36430ed381ea320b
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/quick/items/qquickcanvas.cpp

index da870fd..6de38da 100644 (file)
@@ -411,7 +411,7 @@ void QQuickCanvasPrivate::translateTouchToMouse(QTouchEvent *event)
                 event->setAccepted(true);
             else
                 touchMouseId = -1;
-            if (doubleClick && event->isAccepted()) {
+            if (doubleClick && me.isAccepted()) {
                 touchMousePressTimestamp = 0;
                 QQuickMouseEventEx me = touchToMouseEvent(QEvent::MouseButtonDblClick, p);
                 me.setTimestamp(event->timestamp());