aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickflickable/data
Commit message (Collapse)AuthorAgeFilesLines
* Flickable: ignore trackpad events with px deltas in disallowed directionShawn Rutledge2021-01-151-0/+52
| | | | | | | | | | | | | | | | | If Flickable.flickDirection == HorizontalFlick, then if the accumulated QWheelEvent::pixelDelta()'s abs(dx) > 2 * abs(dy), clearly the user is trying to scroll horizontally; otherwise, don't accept the event. That way the event is allowed to propagate to a parent Flickable that does allow flicking vertically. Likewise if the nesting is the other way around, only allow the inner vertical Flickable to accept if the flicking is actually vertical. Fixes: QTBUG-57245 Fixes: QTBUG-80236 Change-Id: Ieb0bf9310a67210ce7e9fe7a80c88baef2cc7ede Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit dccd8f0b5ca8f6faefb49718e33f9090243f3202) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add tst_qquickflickable::parallelTouchShawn Rutledge2020-11-171-0/+67
| | | | | | | | | | | Prove that we can drag multiple Flickables with multiple touchpoints now. [ChangeLog][QtQuick][Flickable] Flickable now handles touch events directly: you can now drag multiple Flickables with multiple touchpoints. Fixes: QTBUG-30840 Change-Id: I0a3e58595a67f5afb4b93ad64d5280cb3fc52f7a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Teach flickable to handle and replay touch as it does mouseShawn Rutledge2020-11-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Speed up tst_qquickflickableShawn Rutledge2020-10-144-0/+51
| | | | | | | Speed up animations that the test spends too much time waiting to complete. Change-Id: I7941660f3c3a89798c5cdd0eee8018a44fb89a0d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Remove QQuickPointerEvent etc.; deliver QPointerEvents directlyShawn Rutledge2020-09-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-061-0/+38
|\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/types/qqmlbind.cpp src/quick/items/qquicklistview.cpp tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: Id6805c13256ad13d5651011e5dd09bba0ec02987
| * QQuickFlickable: fix division by zeroMitch Curtis2020-01-291-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue could be seen when enabling exceptions and running the following QML code: Flickable { id: flickable anchors.fill: parent contentWidth: 1000 contentHeight: 1000 Text { text: flickable.visibleArea.xPosition } } Change-Id: I615f9f9dc84903fb3a902f416a55e3ce3fece64c Fixes: QTBUG-81098 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | tst_qquickflickable: avoid setContextPropertyFabian Kosmale2019-10-071-0/+1
|/ | | | | Change-Id: Iaf123e647143275cfc9efcd39a1cd5944d599972 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/dev' into wip/pointerhandlerShawn Rutledge2017-04-131-0/+36
|\ | | | | | | Change-Id: Ie2894830470a69827d4ace3d8af9bee971e3fbd4
| * Add tst_qquickflickable::nestedSliderUsingTouchShawn Rutledge2017-03-271-0/+36
| | | | | | | | | | | | | | | | | | | | | | to verify that when a touch-handling component is inside the Flickable, it can control whether the flickable can steal the grab by means of setKeepTouchGrab. Task-number: QTBUG-59416 Task-number: QTBUG-59707 Change-Id: I93cf3abb07a96a69290c3b5b055b688a62fe8fff Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/pointerhandlerShawn Rutledge2017-03-021-0/+13
|\| | | | | | | Change-Id: I7e43a0a47d49de38617f6afc7548f9a9e212a851
| * Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-241-0/+13
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/quick/accessible/qaccessiblequickview_p.h src/quick/items/qquickmousearea.cpp src/quick/util/qquickanimatorjob.cpp tools/qmlplugindump/main.cpp Change-Id: I84474cf39895b9b757403971d2e9196e8c9d1809
| | * Flickable: handle child mouse ungrab when hidden or disabledJ-P Nurmi2017-02-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If Flickable got hidden while a child had mouse grab, it ignored the mouse ungrab event of the child mouse grabber, and got therefore stuck in pressed state. Consequently, item view transitions were not executed since the item view though it was being pressed. Task-number: QTBUG-58453 Change-Id: I76f9f3190c3a95a2fafdce036d69ea1dc8127434 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | build a vector of child-filtering parents before delivery of pointer eventShawn Rutledge2017-01-271-0/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Formerly during normal mouse or touch event delivery, sending it to the Item needed to be done via QQuickWindow::sendEvent, which would then call sendFilteredMouseEvent, which is a recursive function to visit all the item's parents, check whether filtersChildMouseEvents() returns true, if so then return early if childMouseEventFilter() returns true. This is the mechanism by which Flickable (for example) can monitor the movements of an eventpoint even while one of its children has an exclusive grab, and can steal the grab away. Now, we do this by building a vector of such parents first, then visiting them in order. It might be more efficient, it eliminates the recursion, and should eliminate the need for a QSet to ensure that we don't visit the same parent more than once. We can't change the behavior of QQuickWindow::sendEvent() because it's public API, but now we don't use it as much internally. Change-Id: I686fc5612c66eac09ec05c381a648ec65dec3923 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* / Flickable: add horizontal/verticalOvershoot propertiesJ-P Nurmi2016-12-292-0/+134
|/ | | | | | | | | | [ChangeLog][QtQuick][Flickable] Added horizontalOvershoot and verticalOvershoot properties that can be used for implementing boundary actions and effects. Task-number: QTBUG-38515 Change-Id: I06379348a67d03507b56788d6fc7020bbb2d375f Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-102-0/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/quick/quickwidgets/quickwidget/main.cpp src/qml/jsruntime/qv4jsonobject.cpp src/qml/jsruntime/qv4qobjectwrapper.cpp src/qml/jsruntime/qv4qobjectwrapper_p.h src/qml/qml/qqmlengine.cpp src/qml/qml/qqmlpropertycache.cpp src/qml/qml/qqmlpropertycache_p.h src/quick/items/qquickanimatedsprite.cpp src/quick/items/qquickitem.cpp src/quick/items/qquickitem.h src/quick/items/qquickitem_p.h src/quick/items/qquickview_p.h src/quick/scenegraph/qsgcontext.cpp src/quick/scenegraph/qsgdefaultrendercontext.cpp Change-Id: I172c6fbff97208f21ed4c8b6db3d1747a889f22b
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-301-0/+5
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/quick/qquicktext/tst_qquicktext.cpp Change-Id: I241cd418bb7e7b95e0a0a2ee4c465d48be2a5582
| | * Flickable: do not emit movementEnded until it really doesShawn Rutledge2016-09-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was occurring when using a physical mouse wheel: movementEnded was emitted, then contentYChanged would still be emitted a few more times. Task-number: QTBUG-55886 Change-Id: Ib5e833d5d84633bb07b8c240ea3ccc9977e443f8 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * | Fix Flickable state being reset when it replays a delayed press.Andrew den Exter2016-09-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Ignore mouseUngrabEvents() triggered by giving mouse grab to a child item when replaying a delayed press event. Change-Id: I6c8db61167e21bf10d533b17f7cc65e4754bd432 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
* | | Add a test that verifies that keepMouseGrab worksFrederik Gladhorn2016-10-031-0/+22
| | | | | | | | | | | | | | | Change-Id: I17c736994f05a63574b518b1d23facde001eacbf Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Flickable: Fixed rounding errors with contentX/YRiku Palomäki2016-08-181-0/+6
|/ / | | | | | | | | | | | | | | | | | | | | contentX/Y are qreals, but they are rounded using qRound/qFloor/qCeil which will limit the values to 2^31 needlessly. This fix will use (std::)round, std::floor and std::ceil instead to allow bigger values for contentX and contentY. Change-Id: I35ad4bcfa3b8bbc21e90768d348d3002ca400081 Task-number: QTBUG-48018 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-151-0/+19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/quick/demos/photoviewer/deployment.pri One side made it redundant; the other removed part of it; remove it all ! src/quick/scenegraph/util/qsgatlastexture.cpp One side changed a preprocessor condition, the other a code condition, on adjacent lines; keep both changes. tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp One side changed a condition, the other the content of its block; keep both. Change-Id: Idb8937f92a7edb28212449dfe0c5cfdb8e6de986
| * Flickable: fix minXExtent/minYExtent when content is smaller than viewAndrea Bernabei2016-07-011-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment, defining leftMargin (or topMargin) and contentWidth (or contentHeight) so that "leftMargin+contentWidth < flickable.width" (or topMargin+contentHeight < flickable.height) leads to widthRatio (or heightRatio) having value != 1. The value should, however, be 1, as the content is completely visible inside the view, margins included. As a sideeffect, under the assumptions described above, it will now not be possible to scroll the leftMargin (or topMargin) out of screen, something which was possible (and it shouldn't have) before this fix. Task-number: QTBUG-53726 Change-Id: I22426c8038e90a2cfc7445914206eae0e781a3fb Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Updated license headersJani Heikkinen2016-01-201-17/+12
|/ | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Don't send delayed mouse presses to ancestors of the replaying Flickable.Andrew den Exter2015-10-121-2/+8
| | | | | | | | | | | | | If a Flickable delayed a mouse press event and then replayed it later, ancestor items of that Flickable would receive the press twice: once when filtering events of the Flickable, and again when the event was replayed to a descendent of the Flickable. Extend the protection against a Flickable receiving that repeat event to all ancestor items so this doesn't happen. Change-Id: I438c146130c24a7d47e9e8712a1ab08f3d915a06 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
* Emit movement signals for flick().Michael Brasser2015-07-221-0/+26
| | | | | | | | | | | | | | | | | | | | Make flick() more like a real flick and ensure the movement signals and properties are updated. This allows them to be handled from QML. This also fixes issues with flick() and dynamic delegates. Flickable has several checks of the form: !d->pressed && !d->hData.moving && !d->vData.moving That were processed incorrectly for flick(), as the moving variables were not being updated. [ChangeLog][QtQuick][Flickable] The movement related signals and properties are now updated for flicks started via the flick function. Change-Id: I7e96e2e12a4d0a0ee73ddd6f29d95f19c44667b0 Task-number: QTBUG-34507 Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Don't allow a filtering item to block other filtering items.Andrew den Exter2014-07-221-0/+39
| | | | | | | | | | | | | With delayed press it's possible for a filtering item to not accept a press on the first go around but to later steal mouse grab and accept future events. This means outer items which also filter will have received the mouse press, but don't receive release events leading to phantom long presses or inadvertent drags. Task-number: QTBUG-37316 Change-Id: I2ff18df2a019f8d3a5e81a0adc2c5b5994799862 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* Flickable: fix crash in delayed press handlingJ-P Nurmi2014-01-251-0/+18
| | | | | | | Task-number: QTBUG-31328 Change-Id: Ic87e9b4db09242b49f104a8f38e4e420c62db75c Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* Fix Flickable generated release event with pressDelay.Martin Jones2014-01-091-0/+14
| | | | | | | | | Map mouse position to grabber when forwarding release event due to release before pressDelay timeout. Task-number: QTBUG-34570 Change-Id: I7214077c9ac95f77407cf66f9dad52f577eccd79 Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
* Fix Flickable StopAtBounds drag over, back, over behavior.Martin Jones2013-12-051-0/+22
| | | | | | | | | | | | | | | A Flickable with StopAtBounds failed when: 1. position on a boundary. Without lifting your finger: 2. attempt to drag beyond the boundary -> doesn't drag 3. drag back to initiate dragging 4. attempt to quickly drag beyond the boundary. After 4, the view should be back on the boundary, but it could get stuck a little short of the boundary. Change-Id: I9bfbb4293f4d464bddb97c5c37e9bb91ed7d48e4 Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Add missing file to qquickflickable testMartin Jones2013-09-091-0/+26
| | | | | | Change-Id: I69014a85f61bbf1958daa1e4b6cda59534c04a83 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Correctly update flickable visibleArea.heightRatio when geometry changesNils Jeisecke2013-07-311-0/+71
| | | | | | | | | | | | | | | | | | Without this fix the visibleArea.heightRatio and widthRatio values were only updated on geometry changes when flicking was active. So when setting the flickable geometry to the content geometry and thereby disabling flicking the ratios were not updated. This could for example cause wrong scrollbar renderings. The ratios are now also calculated directly after accessing the visibleArea property for the first time. The new autotest covers both problems. Change-Id: I54ba606524557fb328a198c312c1f65eb125c5a3 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Improve the ordering of Flickable dragging and moving property updates.Andrew den Exter2013-03-121-0/+14
| | | | | | | | | | Move the contentItem after the dragging and moving properties have been updated so they return the correct values from the onContentYChanged and onContentXChanged handlers. Task-number: QTBUG-30032 Change-Id: I15716dc8eee4d9836f96362a8b49f1d0c404b0c2 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Flickable shouldn't grab the mouse until it starts an effective move.Andrew den Exter2013-02-221-0/+37
| | | | | | | | | | If the boundBehavior prevents the flickable from moving its content item in response to a drag it shouldn't grab the mouse as that will prevent a parent MouseArea or Flickable from handling the drag. Task-number: QTBUG-29718 Change-Id: I3a1be4ed0132b91dca2fb0387ecefd39275a52da Reviewed-by: Alan Alpert <aalpert@rim.com>
* Flickable: Test case for flicking twice using touchesDaniel d'Andrada2013-01-091-0/+22
| | | | | | | | | | | | When you flick twice in rapid succession, in the same direction, the expected behavior is for flickable to be moving quite fast in the direction of the flicks. This test check for a bug where when you flick using touch events instead of mouse ones, the second flick causes Flickable to immediately halt. Change-Id: I430515d82499b904a1d2e23402b753873490a2d9 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix mouse event distribution for Flickable with pressDelayMatt Vogt2012-11-292-2/+34
| | | | | | | | | | | | | | | | If an item responds to mouse events but does not accept them, it can prevent the events from being processed by the correct item further up the parent chain. For example, a text item inside a mouse area can wrongly consume a press event, so that the following release event does not yield a click when processed by the mouse area. Rather than speculatively assigning the mouse grab to items during event filter processing, change Flickable to retain the grab for the duration of the pressDelay and to release it during replay of the press event. Change-Id: Ied12b9643838a984c7026978047465c2830e55e4 Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* Nested Flickables with pressDelay flick incorrect FlickableMartin Jones2012-11-261-18/+24
| | | | | | | | | | | If the gesture is triggered within the pressDelay the outer Flickable will always handle the gesture. When the drag distance is exceeded replay the press event to allow all Flickables an opportunity to process the gesture normally. Task-number: QTBUG-28189 Change-Id: I36912cc19a48c90ae7a9a430580a8f40071bd5fd Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Adjust Flickable autotest to check mouse events with transformationAdriano Rezende2012-07-141-0/+43
| | | | | | | Tests mouse events with graphical transformations applied to the element. Change-Id: I767a40ca0d5ed748bcb27ad23212ddbc22272fc5 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* rebound property for FlickableBea Lam2012-06-082-0/+51
| | | | | | | | This property specifies the transition to be used when the flickable snaps back to its bounds. Change-Id: I2bb9680dad219a4c7c911f0e4dda37ae739349c6 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Don't emit moving and flicking signals unnecessarilyBea Lam2012-06-061-1/+1
| | | | | | | | | | | | | | | | The moving and flicking signals should only be emitted once when the view has been moved/flicked both vertically and horizontally. (This was already done correctly for the dragging signals.) Also changes QQuickFlickable::flick() to return bool instead of void. Subclasses no longer emit the flicking signals but call flickingStarted() instead. Also splits the tst_qquickflickable::movingAndDragging() test up into several tests. Change-Id: Ie527568a9702049dd0bcda18c2eb3e43d8938a18 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Restore view to sensible position if grab is cancelled.Martin Jones2012-03-201-0/+15
| | | | | | | If the mouse grab is stolen, return to allowed bounds. Change-Id: Icc44da32ff62bed273f0ccbb5498766981cdf9a4 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-2410-0/+195
Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>