aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/touchmouse
Commit message (Collapse)AuthorAgeFilesLines
* Move event delivery from QQWindow to QQuickDeliveryAgentShawn Rutledge2021-02-251-7/+7
| | | | | | | | | | | | | | | | | | | | | | QQuickWindow owns QQuickRootItem which owns QQuickDeliveryAgent, so for every window there's an object responsible for event delivery, while the window itself is mainly responsible for rendering (separation of concerns). However, QQuickRootItem and QQuickDeliveryAgent can now be used in cases where the scene doesn't directly belong to a window, such as when a Qt Quick sub-scene is mapped somewhere into a Qt Quick 3D scene. In that case, we must remember which delivery agent was in use at the time when a QEventPoint is grabbed and deliver subsequent updates via the same DA. There's also a QQuickDeliveryAgent::Transform abstraction which subscene-management code (such as QQuick3DViewport) can implement, to provide a formula to map the window's scene coordinates to subscene coordinates; if defined, it will be used during delivery of subsequent updates to existing grabbers. Task-number: QTBUG-84870 Change-Id: I70b433f7ebb05d2e60214ff3192e05da0aa84a42 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 68c103225f4e8bd6c1b18ef547108fd60f398c0f) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove the qmake project filesFabian Kosmale2021-01-151-16/+0
| | | | | | | | | Remove all qmake project files, except for examples which are used to test that qmake continues to work. Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Un-blacklist tst_TouchMouse::hoverEnabledShawn Rutledge2020-12-011-3/+0
| | | | | | | Task-number: QTBUG-86729 Task-number: QTBUG-40856 Change-Id: I6936833236b584d9f91cca1583434fa9982ec569 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Clean up tst_TouchMouseShawn Rutledge2020-11-171-424/+358
| | | | | | | | | | - The view-showing boilerplate is reduced - Uncommented and fixed up some statements that were failing at one time - Fixed override warnings - Use qCDebug not qDebug Change-Id: Ib437cc985c03776492da2502ecdb5176afadadf2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Don't synthesize mouse from touch for items that accept touchShawn Rutledge2020-11-172-98/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Followup to 1457df74f4c1d770e1e820de8cd082be1bd2489e : if an item that has acceptTouchEvents() == true merely fails to accept one touch event, that does not mean a mouse event should be sent. Finish changing the default to false: handling touch events is opt-in, just like handling mouse events; most items don't. And if you opt in, then you MUST handle touch events, because you will NOT receive mouse events as a fall-back. Now that Flickable handles touch, filtering multi-touch events becomes relevant. There was a failure in tst_touchmouse::mouseOnFlickableOnPinch when Flickable grabs a stationary touchpoint at the same time as another touchpoint is pressed, preventing a child PinchArea from reacting. So there's a new rule: just as we start over with event delivery when a new point is pressed, QQuickFlickable::filterPointerEvent() should also not immediately grab when any point is newly pressed; it can afford to wait, because it's filtering, so it will be able to see if one point is dragged past the drag threshold later on. When a parent (such as Flickable) contains only mouse-handling items (such as MouseArea), the parent should filter the touch event if it is able (if acceptTouchEvents() returns true). Flickable is now able to. Filtering parents that are not able to filter touch events can still filter a synth-mouse event as before. But filtering both must be avoided: then we would have the problem that Flickable filters a touch move, sees that it's being dragged past the drag threshold, and sets d->stealMouse to true to indicate that it wants to steal the _next_ event; then it filters a synth-mouse move, and that's perceived as being the next event even though it's just a different view of the same event, so it steals it. In tst_qquickflickable::nestedMouseAreaUsingTouch we rely on the delay caused by waiting for the next event: the MouseArea is trying to drag an item and the Flickable wants to flick; both of them decide on the same event that the drag threshold is exceeded. But MouseArea calls setKeepMouseGrab() immediately, whereas Flickable doesn't try to steal the grab until the next event, and then it sees the keepMouseGrab flag has been set, so it doesn't do it. If Flickable could filter the same event twice (once as touch, once as synth-mouse), this logic doesn't work, so it's effectively "more grabby" than intended. So it works better to have it filter only the actual touch event, not the synth-mouse that comes after. When the child has pointer handlers, we need to visit them, and therefore we should let Flickable filter a touch event on the way. tst_FlickableInterop::touchDragFlickableBehindButton() depends on this. [ChangeLog][QtQuick][QQuickWindow] In Qt 6, a QQuickItem subclass must explicitly call setAcceptTouchEvents(true) to receive QTouchEvents, and then it must handle them: we no longer fall back to sending a QMouseEvent if the touch event is not accepted. If it has additionally called setFiltersChildMouseEvents(true), then it will filter touch events, not any synthetic mouse events that may be needed for some children. Task-number: QTBUG-87018 Fixes: QTBUG-88169 Change-Id: I8784fe097198c99c754c4ebe205bef8fe490f6f4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Teach flickable to handle and replay touch as it does mouseShawn Rutledge2020-11-111-44/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickWindowPrivate::cloneMouseEvent() renamed to clonePointerEvent() and generalized to be able to clone any of the kinds of QPointerEvent that we're interested in replaying. Now it is used only in QQuickFlickablePrivate::captureDelayedPress(). Reverts f278bb7c66bb00c9f81b7a3aceeb94cb9b3a1b66 and 012a4528a515af8d7ec7dbc05a38d8fd0d6d4d1b (don't skip tst_TouchMouse::buttonOnDelayedPressFlickable). Some test changes from f128b5dee8a2a03ebc55ed0cd1e749a6599282c3 also get reverted. QEventPoint should always have valid velocity now, so Flickable no longer has to calculate it for itself. Removing that became necessary to fix the movingAndFlicking test. Adds logging categories qt.quick.flickable.filter and .replay. Fixes: QTBUG-85607 Task-number: QTBUG-83437 Task-number: QTBUG-78818 Task-number: QTBUG-61144 Task-number: QTBUG-88038 Task-number: QTBUG-88138 Change-Id: I0ed6802dff5e5d1595adddc389642925f1f2c93d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Improve tst_TouchMouse::pinchOnFlickableShawn Rutledge2020-10-281-40/+23
| | | | | | | | | | | - use for loops instead of tedious repetition - compare instead of verify to check negative bools - QTRY_COMPARE instead of qWait - move touchpoints by drag threshold to ensure repeatability: both flickable and pincharea wait for the threshold to start reacting Change-Id: I071fc05280e2156223af57d97079516987a744ab Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Make touchmouse pinch test qml manually testable and visually sensibleShawn Rutledge2020-10-282-14/+21
| | | | | | | | | | | - There was no reason to import Qt.test - Make colors less garish - Explain what the rectangle is for (it's not the only place for pinching, and the appearance is a bit misleading) - Show click feedback at the position instead of toggling colors Change-Id: Id75a52e46a5e8611a57eb69a037cced9a9f7d54f Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-061-3/+3
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* Un-blacklist Quick tests that are passingShawn Rutledge2020-10-061-3/+0
| | | | | | Task-number: QTBUG-86729 Change-Id: I35dc7ac91d2507a229dc1dde19f380e7111a4757 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Blacklist various failing testsShawn Rutledge2020-09-251-0/+4
| | | | | | | | | | | | tst_qqflickable::nestedStopAtBounds, nestedSliderUsingTouch tst_QQuickMouseArea::preventStealing, nestedFlickableStopAtBounds tst_QQuickMultiPointTouchArea::inFlickable2, inFlickableWithPressDelay tst_QQuickPathView::nestedinFlickable, touchButtonOnFlickable, touchGrabCausesMouseUngrab tst_qqmlpropertycache::derivedGadgetMethod Task-number: QTBUG-86729 Change-Id: Ie11a50c25f90fde2636b05a72f51640643b33dec Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove QQuickPointerEvent etc.; deliver QPointerEvents directlyShawn Rutledge2020-09-181-39/+85
| | | | | | | | | | | | | | | | | | | | | | | QEventPoint does not have an accessor to get the QPointerEvent that it came from, because that's inconsistent with the idea that QPointerEvent instances are temporary, stack-allocated and movable (the pointer would often be wrong or null, therefore could not be relied upon). So most functions that worked directly with QQuickEventPoint before (which fortunately are still private API) now need to receive the QPointerEvent too, which we choose to pass by pointer. QEventPoint is always passed by reference (const where possible) to be consistent with functions in QPointerEvent that take QEventPoint by reference. QEventPoint::velocity() should be always in scene coordinates now, which saves us the trouble of transforming it to each item's coordinate system during delivery, but means that it will need to be done in handlers or applications sometimes. If we were going to transform it, it would be important to also store the sceneVelocity separately in QEventPoint so that the transformation could be done repeatedly for different items. Task-number: QTBUG-72173 Change-Id: I7ee164d2e6893c4e407fb7d579c75aa32843933a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Skip tst_TouchMouse::buttonOnDelayedPressFlickable on macOSUlf Hermann2020-09-151-0/+4
| | | | | Change-Id: I1b1b5d00ae8bef77ad63f8df5ec893b045e21923 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Replace QTouchEvent::TouchPoint with QEventPointShawn Rutledge2020-07-151-4/+4
| | | | | | | | | | | | It's a cosmetic change at this time, because we have declared using TouchPoint = QEventPoint; Also replace Qt::TouchPointState enum with QEventPoint::State. Task-number: QTBUG-72173 Change-Id: Ife017aa98801c28abc6cccd106f47a95421549de Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Temporarily skip part of tst_TouchMouse::buttonOnDelayedPressFlickableShawn Rutledge2020-07-151-0/+1
| | | | | | | | | | We can revisit tests involving the replaying of press events soon, after getting them replayed as the original type, i.e. stop synthesizing mouse for touch during replay. Task-number: QTBUG-85607 Change-Id: Ib978c84a5e61bb21e0dc017eb386cadec5390418 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Use QList instead of QVectorJarek Kobus2020-06-251-1/+1
| | | | | | Task-number: QTBUG-84469 Change-Id: I4c3353c00a566023503fbc178ba8454391dc334c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Remove QQuickPointerDevice in favor of QPointingDeviceShawn Rutledge2020-06-231-9/+4
| | | | | | | | | | | | | | ...and generally deal with changes immediately required after adding QInputDevice and QPointingDevice. Also fixed a few usages of deprecated accessors that weren't taken care of in 212c2bffbb041aee0e3c9a7f0551ef151ed2d3ad. Task-number: QTBUG-46412 Task-number: QTBUG-69433 Task-number: QTBUG-72167 Change-Id: I93a2643162878afa216556f10808fd92e0b20071 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Replace calls to deprecated QEvent accessor functionsShawn Rutledge2020-06-111-8/+8
| | | | | | | | | | | | | | | | | | | | Several event accessors were deprecated in qtbase/24e52c10deedbaef833c0e2c3ee7bee03eacc4f5. Replacements were generated by clazy using the new qevent-accessors check: $ export CLAZY_CHECKS=qevent-accessors $ export CLAZY_EXPORT_FIXES=1 $ ../qt6/configure -platform linux-clang -developer-build -debug -no-optimize-debug -opensource -confirm-license -no-pch QMAKE_CXX=clazy $ make $ cd ../../qt6/qtdeclarative $ find . -name "*.clazy.yaml" $ clang-apply-replacements . Task-number: QTBUG-20885 Task-number: QTBUG-84775 Change-Id: I1be5819506fd5039e86b4494223acbe193e6b0c9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* CMake: Update Apple platform defines after rename in qtbaseTor Arne Vestbø2020-03-171-2/+2
| | | | | Change-Id: Ia0a075e3199eab735f9b289873beeb8730ebc47e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Regenerate qtdeclarativeAlexandru Croitor2020-02-121-5/+2
| | | | | | | Change-Id: I48d7fd306f3d1b161a8e73029282ee591b1ef612 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-01-291-0/+4
|\ | | | | | | | | | | | | Conflicts: dependencies.yaml Change-Id: Ie3e9dc62031a85e5e81cbdf04694b95159d49fca
| * Blacklist tst_TouchMouse::touchButtonOnFlickable() on mingwUlf Hermann2020-01-151-0/+4
| | | | | | | | | | | | | | Task-number: QTBUG-74517 Change-Id: I9733fe53f65d107c830b2fe47a475b2159a70540 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Regenerate all projects with new CMake API versionAlexandru Croitor2019-11-151-3/+3
| | | | | | | | | | | | Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Regenerate testsAlexandru Croitor2019-11-141-11/+2
| | | | | | | | | | | | Change-Id: I67a6c8f1659e7b471a4fcb92a2699292cf4eea81 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add QtDeclarative Test CoverageLeander Beernaert2019-08-141-0/+56
|/ | | | | | | | | | | | | | | | | | | | | | All tests compile and run on a developer build. These tests are failing: tst_qqmlsqldatabase Fails due to missing sql driver tst_qqmlsqldatabase Fails in wip/qt6 tst_ququicklayouts Fails in wip/qt6 tst_flickableinterop Fails in wip/qt6 tst_qquickpinchandler Fails in wip/qt6 tst_qquickflickable Fails in wip/qt6 tst_qquickgridview Fails in wip/qt6 tst_qquickimage Fails due to missing jpeg plugin tst_qquicklistview Fails in wip/qt6 tst_qquicktext Fails in wip/qt6 tst_qquickcanvasitem Fails in wip/qt6 tst_scenegraph Fails due to missing jpeg plugin tst_TestFiltering Fails in wip/qt6 Change-Id: I4b9d69c118e23c095cb72ad5a67653fc30943bb1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Blacklist tst_TouchMouse::buttonOnFlickable() on mingwUlf Hermann2019-03-201-0/+4
| | | | | | Task-number: QTBUG-74517 Change-Id: I3e0a90a264f8f686bba89e6b8dc4ebcf05418f77 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Un-blacklist tst_touchmouse::hoverEnabledShawn Rutledge2018-12-131-3/+0
| | | | | | | | | See if this is stable yet. Recent coin statistics seems to say it's been passing. Task-number: QTBUG-40856 Change-Id: I49372cc514971acf26ac9b9b9a86ea2eb46a9773 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-10-081-38/+66
|\ | | | | | | | | | | | | | | Conflicts: src/3rdparty/masm/yarr/YarrJIT.h src/quick/items/qquickwindow.cpp Change-Id: I551404e1558d56c0b0626346ad1c86406bff0ec7
| * Amend TouchMouse::buttonOnDelayedPressFlickable to test delayed tapShawn Rutledge2018-10-031-38/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test is for Flickable with pressDelay set to a testable timeout value. For some reason it only checked trying to flick before the press delay is over, or holding and waiting for the press delay to expire. But if the user taps a child MouseArea before the press delay expires (neither moving nor waiting), at the moment of release it's supposed to send the delayed press and then the release, so that the MouseArea gets "clicked" almost as if there was no delay. Lack of test coverage allowed a regression in this functionality for 2 minor versions: 5.10 and 5.11. Task-number: QTBUG-61144 Task-number: QTBUG-69059 Change-Id: I0d8867587e6877359c41ec5fc3a5cdd17447d0b8 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | QQuickWindow: obey AA_SynthesizeMouseForUnhandledTouchEventsShawn Rutledge2018-08-061-22/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Quick tests: remember positions of stationary pointsShawn Rutledge2018-07-031-24/+26
|/ | | | | | | | | | | | | | | | We need Items to receive accurate positions for stationary touch points: that is, the last-known position from the previous touch event. (And we hope that all actual touch-capable platforms also send proper QPA events with correct positions for stationary points. We assert that it's a bug if they don't.) As explained in qtbase 7cef4b6463fdb73ff602ade64b222333dd23e46c, it's OK to retain a copy of a QTest::QTouchEventSequence for this purpose, so that the QMap<int, QTouchEvent::TouchPoint> previousPoints will not be discarded between events. Change-Id: I12a04323b0d82dc325348c0fa3e067a4b63f57e9 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* stabilize tst_TouchMouse::touchButtonOnFlickableShawn Rutledge2018-03-021-1/+1
| | | | | | | | | | | | FAIL! : tst_TouchMouse::touchButtonOnFlickable() Compared values are not the same Actual (eventItem2->touchUngrabCount): 0 Expected (1) : 1 tst_touchmouse.cpp(673) : failure location Task-number: QTBUG-66278 Change-Id: I20ed910091b7c894aeaf6639d738105022730940 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* init variables where they are declared when possible (clang-tidy)Shawn Rutledge2018-02-261-6/+6
| | | | | | | | clang-tidy -p compile_commands.json $file -checks='-*,modernize-use-default-member-init,readability-redundant-member-init' -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' -header-filter='qtdeclarative' -fix Change-Id: I705f3235ff129ba68b0d8dad54a083e29fcead5f Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-21/+21
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-241-0/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/compiler/qv4codegen.cpp src/qml/compiler/qv4compileddata_p.h src/qml/debugger/qqmlprofiler_p.h src/qml/jsruntime/qv4engine.cpp src/qml/memory/qv4mm.cpp src/qml/qml/qqmlcomponent.cpp src/qml/qml/qqmlobjectcreator.cpp src/qml/qml/qqmlobjectcreator_p.h src/qml/types/qqmldelegatemodel.cpp src/quick/items/qquickitem_p.h src/quick/items/qquickwindow.cpp tests/auto/quick/touchmouse/BLACKLIST tests/benchmarks/qml/holistic/tst_holistic.cpp Change-Id: I520f349ab4b048dd337d9647113564fc257865c2
| * Blacklist tst_TouchMouse::buttonOnDelayedPressFlickable() on mingwUlf Hermann2018-01-181-0/+2
| | | | | | | | | | | | | | | | | | It is flaky and needs to be fixed. Task-number: QTBUG-65823 Change-Id: I471754631493eed20400a2a57b7e55c5007e55f7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/pointerhandlerJan Arve Saether2017-07-111-8/+4
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: examples/quick/shared/LauncherList.qml src/quick/items/qquickevents.cpp src/quick/items/qquickevents_p_p.h src/quick/items/qquickwindow.cpp tests/auto/quick/touchmouse/tst_touchmouse.cpp Change-Id: Id692d291455093fc72db61f1b854f3fc9190267b
| * Merge "Merge remote-tracking branch 'origin/5.9.0' into 5.9" into ↵Frederik Gladhorn2017-05-101-6/+3
| |\ | | | | | | | | | refs/staging/5.9
| | * Move pointerEvent instance to QQuickWindowJan Arve Saether2017-05-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With two or more windows, if events are being delivered to each, the grabbers can be different in each. We need unique instances of the QQuickPointerEvent objects for each window to avoid losing the grab state in the parent window while delivering a synthesized event to a subwindow, for example. Change-Id: I51da1212d573853969e32ad78f5b219d979a8a5c Task-number: QTBUG-57253 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| | * Fix hover delivery in case of touch release eventsFrederik Gladhorn2017-05-101-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes tst_TouchMouse::hoverEnabled. It turns out that the problem is that QQuickWindowPrivate::flushFrameSynchronousEvents would deliver artificial hover events which (due to the nature of the function) would arrive without being synchronized with the test. This should not be a problem as such, but there was one bug: the hover event would also be sent in case of a touch release event. The definition of when to "pretend hover" is a bit shaky, but we should definitely not send hover events after touch releases. By clearing lastMousePosition instead of setting it to where the touch point is released we no longer receive bogus events. Task-number: QTBUG-55350 Change-Id: I4dea54740e37182f66c4a729d7b06a1c770c34a9 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | Remove unused variableFrederik Gladhorn2017-05-101-1/+0
| |/ | | | | | | | | Change-Id: I85a5c94f8a9b1fcb52f3967f0ce521ffb34cfa0f Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* | touchmouse autotest: add debug operator for the test-specific Event typeShawn Rutledge2017-05-111-0/+16
| | | | | | | | | | | | | | | | | | It's nice to be able to do qDebug() << eventItem->eventList when troubleshooting behavior in case of test failure. Change-Id: I2b50d5b092a0c9eb4eab3105be66a36aedf871bb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Default QQuickItem::acceptTouchEvents to true until Qt 6Shawn Rutledge2017-05-101-0/+2
| | | | | | | | | | | | | | | | This is a partial revert of 1457df74f4c1d770e1e820de8cd082be1bd2489e to avoid making a mandatory API change so soon. Change-Id: I05040579fa36d3dc5ef7616861f6d17adf500d2c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Add QQuickItem acceptTouchEvents/setAcceptTouchEvents; require for touchShawn Rutledge2017-04-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It has been suboptimal to speculatively deliver touch events to Items which are not interested; even worse is when we must deliver to a parent item which is filtering events, when the child Item will not accept the touch event anyway. So now it is required that any QQuickItem subclass which wishes to accept touch events must call setAcceptTouchEvents(true) (typically in its constructor). If it does not do this, it will not get any touch events (and this saves us the trouble of looking for parents which filter touch events, too). It is consistent with needing to call setAcceptHoverEvents() to get hover events, and setAcceptedMouseButtons() to get mouse events. [ChangeLog][QtQuick][QQuickItem] When subclassing QQuickItem, it is now required to call setAcceptTouchEvents(true) if you need the item to receive touch events. Change-Id: Idc76c04f4e7f1d4a613087e756e96dac368f4f23 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/pointerhandlerShawn Rutledge2017-04-131-4/+72
|\| | | | | | | Change-Id: Ie2894830470a69827d4ace3d8af9bee971e3fbd4
| * When stealing a touchpoint as synth. mouse, ungrab touchFrederik Gladhorn2017-03-011-4/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you use MultiPointTouchArea to make a button component, or if you do something similar by subclassing QQuickItem and handling touch events, and you place such a component inside a Flickable, when the user presses on the button and then drags far enough that the Flickable steals the grab, the MPTA or custom item did not receive the touchUngrabEvent() callback. Now it does, so now the button will go back to released state as a result of having the grab stolen. The situation here is special in that it's the only place where a touch event is transformed to be treated as mouse in the future, usually it's either treated as touch or mouse from the start. When this happens, it's not enough to call setMouseGrabber because that doesn't send touch cancel to the previous grabber. Instead we need to explicitly call touchUngrabEvent to notify the touch handling item. The explicit setting of the grabber which was there previously is not needed, since grabMouse will update the grab based on touchMouseId. tst_QQuickMultiPointTouchArea::inFlickable2 was already testing the pressed state of the touchpoint when the grab is stolen, but it was changed in 468626e99a90d6ac21cb311cde05c658ccb3b781; now that can be restored, and we can also un-blacklist inFlickable, which was deemed unstable in 6d163779711d4601931ae0f82910794fb2498136 [ChangeLog][QtQuick] MultiPointTouchArea, and any custom Item, will now properly receive touchUngrabEvent() when the touch grab is stolen by a filtering parent Item, such as a Flickable. Task-number: QTBUG-57910 Change-Id: I4e1b23ed099f01e7eca2e8a0e7ab4c652ef00cfa Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/pointerhandlerShawn Rutledge2017-03-021-0/+32
|\| | | | | | | Change-Id: I7e43a0a47d49de38617f6afc7548f9a9e212a851
| * Add TouchMouse::implicitUngrab autotestJan Arve Saether2017-02-281-0/+32
| | | | | | | | | | | | | | Task-number: QTBUG-57797 Task-number: QTBUG-59098 Change-Id: I3bf9ad33c22cdbd82f3efbdbfc35f63371c04bed Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | clarify further exclusive vs. passive grabsShawn Rutledge2017-02-201-3/+3
| | | | | | | | | | | | | | | | | | | | Add documentation to the grab-related event and eventpoint methods. Rename "grabber" functions which relate only to the exclusive grab, in cases where it would otherwise be ambiguous. And a few other documentation changes. Change-Id: I1a203c8c06a19d4abdb000f08b387c38341ef476 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | blacklist tst_TouchMouse::hoverEnabledShawn Rutledge2017-02-021-0/+3
|/ | | | | | | | | This should be fixed somehow before merging to dev branch, but the test is blocking work, and maybe doesn't quite make sense yet anyway. Task-number: QTBUG-40856 Change-Id: Icffd3589313df1683550a19347a1d6c5282a619c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>