From 4730e5d9b3574019f67ba29283308d5020385b59 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 2 May 2013 15:57:01 +0200 Subject: [PATCH] mouse synthesis: don't say the left button is pressed during a release Follows the same reasoning as Iefe63cd753f9f8bb04278fd04a4d728e3deda25e in qtbase: buttons should have only the buttons which are still pressed. Change-Id: I894df43254eb1b1ce173fd7acc7190e9765beb48 Reviewed-by: Richard Moe Gustavsen Reviewed-by: Frederik Gladhorn --- src/quick/items/qquickwindow.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 2640e66..ad13489 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -411,7 +411,7 @@ static QMouseEvent *touchToMouseEvent(QEvent::Type type, const QTouchEvent::Touc { // The touch point local position and velocity are not yet transformed. QMouseEvent *me = new QMouseEvent(type, transformNeeded ? item->mapFromScene(p.scenePos()) : p.pos(), p.scenePos(), p.screenPos(), - Qt::LeftButton, Qt::LeftButton, event->modifiers()); + Qt::LeftButton, (type == QEvent::MouseButtonRelease ? Qt::NoButton : Qt::LeftButton), event->modifiers()); me->setAccepted(true); me->setTimestamp(event->timestamp()); QVector2D transformedVelocity = p.velocity(); -- 1.7.2.5