diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-01-31 12:54:40 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-08-06 12:46:08 +0000 |
commit | acf7c8073b0c8a0440c62f66469865f8bf1decd5 (patch) | |
tree | 9b95b0cc7833172d9036a87cafda1b67e165945e /tests/auto/quick/pointerhandlers/flickableinterop | |
parent | 814ff4c73ced4706da8ca72e5124a59523e5efc4 (diff) |
QQuickWindow: obey AA_SynthesizeMouseForUnhandledTouchEvents
Until now, AA_SynthesizeMouseForUnhandledTouchEvents has only affected
behavior of QGuiApplicationPrivate::processTouchEvent, but had no
effect in Qt Quick. QQuickWindow also accepts the touch event
just to make sure that QGuiApplication will not synthesize mouse
from touch, because it would be redundant: QQuickWindow does that
for itself.
Now we make it have an effect in Qt Quick too: skip mouse synthesis
if it is set to false. This provides a way to simplify the
event delivery. If you set it false, then you cannot manipulate old
mouse-only items like MouseArea and Flickable on a touchscreen.
(You can of course use event handlers for that.)
[ChangeLog][QtQuick][QQuickWindow] You can now disable touch->mouse
event synthesis in QtQuick by calling
qGuiApp.setAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents, false);
This will simplify and speed up event delivery, and it will also prevent
any and all interaction with mouse-only items like MouseArea and
Flickable on a touchscreen.
Task-number: QTBUG-52748
Change-Id: I71f1731b5abaeabd9dbce1112cd23bc97d24c12a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'tests/auto/quick/pointerhandlers/flickableinterop')
-rw-r--r-- | tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp b/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp index 2d8b16cadd..e544eedf05 100644 --- a/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp +++ b/tests/auto/quick/pointerhandlers/flickableinterop/tst_flickableinterop.cpp @@ -57,8 +57,6 @@ public: {} private slots: - void initTestCase(); - void touchTapButton_data(); void touchTapButton(); void touchDragFlickableBehindButton_data(); @@ -96,14 +94,6 @@ void tst_FlickableInterop::createView(QScopedPointer<QQuickView> &window, const QVERIFY(window->rootObject() != nullptr); } -void tst_FlickableInterop::initTestCase() -{ - // This test assumes that we don't get synthesized mouse events from QGuiApplication - qApp->setAttribute(Qt::AA_SynthesizeMouseForUnhandledTouchEvents, false); - - QQmlDataTest::initTestCase(); -} - void tst_FlickableInterop::touchTapButton_data() { QTest::addColumn<QString>("buttonName"); |