From e9760f1559361c39f269fb89f1ebd01f6ee8378d Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Mon, 11 Mar 2013 14:41:52 +0100 Subject: Fix the check if mouse events should be synthesized from touch events In QGuiApplication only Qt::AA_SynthesizeMouseForUnhandledTouchEvents is taken into account when synthesizing mouse from touch events, in QApplication only the PlatformIntegration syle hint QPlatformIntegration::SynthesizeMouseFromTouchEvents. With this patch both attributes are checked. Furthermore the check was moved out of translateTouchToMouse in QApplication in order not to influence the result which is returned to the user, when mouse events are not be synthesized. Change-Id: I87ac7299f0a9fbf0a083eff9c547f0dbfab75dfb Reviewed-by: Fabian Bumberger Reviewed-by: Shawn Rutledge --- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/auto/gui/kernel/qwindow/tst_qwindow.cpp') diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index b67920737e..29c72cc02e 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -41,6 +41,8 @@ #include #include +#include +#include #include @@ -484,6 +486,8 @@ void tst_QWindow::testInputEvents() void tst_QWindow::touchToMouseTranslation() { + if (!QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::SynthesizeMouseFromTouchEvents).toBool()) + QSKIP("Mouse events are synthesized by the system on this platform."); InputTestWindow window; window.ignoreTouch = true; window.setGeometry(80, 80, 40, 40); @@ -684,6 +688,8 @@ void tst_QWindow::touchCancel() void tst_QWindow::touchCancelWithTouchToMouse() { + if (!QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::SynthesizeMouseFromTouchEvents).toBool()) + QSKIP("Mouse events are synthesized by the system on this platform."); InputTestWindow window; window.ignoreTouch = true; window.setGeometry(80, 80, 40, 40); -- cgit v1.2.3