aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickmultipointtoucharea.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2013-09-20 14:01:30 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-14 17:53:51 +0200
commit9443e72a92a4d1d717e931ee9149c1e3652e9f53 (patch)
tree86e152f7c4564eb6a8a24dfca69178a1ff7ddbfc /src/quick/items/qquickmultipointtoucharea.cpp
parent22d994ba7b6f3d2f5833a092d15a71d03c309c55 (diff)
Ignore mouse events synthesized by the OS in Quick2
Make QQuickWindow ignore mouse events generated by the system from touch events (e.g. on Windows). This will allow us to remove the mousefromtouch parameter for the windows plugin and restore accepting all mouse events in the platform plugin as the default behavior. Change-Id: I82ff5fa97b02ebc69b61735e2366176e0a6a406c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/quick/items/qquickmultipointtoucharea.cpp')
-rw-r--r--src/quick/items/qquickmultipointtoucharea.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/items/qquickmultipointtoucharea.cpp b/src/quick/items/qquickmultipointtoucharea.cpp
index 8fe306b006..6b273dcd43 100644
--- a/src/quick/items/qquickmultipointtoucharea.cpp
+++ b/src/quick/items/qquickmultipointtoucharea.cpp
@@ -43,6 +43,7 @@
#include <QtQuick/qquickwindow.h>
#include <private/qsgadaptationlayer_p.h>
#include <private/qquickitem_p.h>
+#include <private/qguiapplication_p.h>
#include <QEvent>
#include <QMouseEvent>
#include <math.h>
@@ -675,6 +676,10 @@ bool QQuickMultiPointTouchArea::sendMouseEvent(QMouseEvent *event)
QMouseEvent mouseEvent(event->type(), localPos, event->windowPos(), event->screenPos(),
event->button(), event->buttons(), event->modifiers());
mouseEvent.setAccepted(false);
+ QGuiApplicationPrivate::setMouseEventCapsAndVelocity(&mouseEvent,
+ QGuiApplicationPrivate::mouseEventCaps(event),
+ QGuiApplicationPrivate::mouseEventVelocity(event));
+ QGuiApplicationPrivate::setMouseEventSource(&mouseEvent, Qt::MouseEventSynthesizedByQt);
switch (mouseEvent.type()) {
case QEvent::MouseMove: