aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/drawer/tst_drawer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename tst_Drawer to tst_QQuickDrawerJ-P Nurmi2017-09-271-1224/+0
| | | | | Change-Id: I186b3ed95eda5178f861bc501be481c971641767 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix non-modal drawer drag/swipe open and closeMichal Policht2017-09-061-0/+83
| | | | | | | | | | Function QQuickPopupPrivate::blockInput() has been overridden in QQuickDrawerPrivate to accept events that occur while mouse/touch is grabbed and events within drag area. Task-number: QTBUG-59652 Change-Id: Icf4129e702a351b266ea9c4544830185c315fc37 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* QQuickDrawer: fix multi-touch leaking through modal overlayJ-P Nurmi2017-07-141-0/+115
| | | | | | | | | | The first touch point was blocked as appropriate, but the consequent touch points were leaking through to other popups below Drawers' modal overlay. Task-number: QTBUG-61581 Change-Id: I1c3e28e3d25b7489c4a9b684107fd1b5158e1674 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix drawers not to be touch-draggable through modal popup shadowsJ-P Nurmi2017-05-081-0/+59
| | | | | | | | | | | | | | Material style popups have a shadow outside the popup. QQuickOverlay cannot block press events to children of a popup, because otherwise interacting with popup contents would be impossible. However, since the shadow is outside of the popup, touch events don't propagate to the popup and get naturally blocked by the popup background. Instead, the touch event propagates to the overlay. At this point, we must do an additional check whether we're allowed to start dragging a drawer. Task-number: QTBUG-60602 Change-Id: I9b5c81246bca7ea40bce0e46dc2e94558a0b9204 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Drawer: fix dragging from the inside over interactive contentsJ-P Nurmi2017-05-081-10/+20
| | | | | | Task-number: QTBUG-60598 Change-Id: I65e6e9440c9450fbec4a53b9ee60e11b919c090a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Drawer: fix drag-over-threshold calculationJ-P Nurmi2017-05-021-20/+45
| | | | | | | | | | Don't steal a horizontal drag if a flickable has been dragged a long distance vertically, and then later the flick happens to exceed the horizontal drag threshold. Change-Id: Idf39997aa20cc41da561f182119199f30c63ba32 Task-number: QTBUG-60521 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickPopopPositioner: fix reposition() callsJ-P Nurmi2017-05-021-0/+10
| | | | | | | | | | QQuickDrawer still overrides QQuickPopupPrivate::reposition(), so it must be called instead of calling QQuickPopupPositioner::reposition() directly. Task-number: QTBUG-60493 Change-Id: I45ba7364c32d89d2fd128c07f68274b962467ced Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: fix flicking inside drawersJ-P Nurmi2017-04-281-22/+66
| | | | | | | | The pressPoint must be stored before rejecting a press event, to be able to calculate correctly when to steal/grab move. Change-Id: I4c9225fdaf730800fec30b3f37a2a0fe773e8b03 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: don't jump when dragging openJ-P Nurmi2017-04-241-15/+25
| | | | | | | | | | | | | | | | Typically drawer's drag margin is so small that one can barely notice that it jumps when dragging begins. On systems with larger start drag distance, or when drawer's drag margin is manually increased, the jump was noticeable and disturbing. Unfortunately several tests had to be adjusted accordingly, because they were assuming that pressing at the edge and then dragging in the middle would immediately snap the drawer. Now the tests are sending a press at the edge, first moving past the start drag distance, and then moving to the actual tested position. Change-Id: Id8badf256fd4dd51f34db76ebe03bf6b15203cd9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_Drawer: disable compression for touch eventsJ-P Nurmi2017-04-241-3/+10
| | | | | | | | | | Touch event compression makes auto tests unpredictable and is causing headache for the upcoming "smooth dragging" changes. Disable touch event compression and remove the manual flushing that is no longer needed. Change-Id: I1264203255d1c796829479026c84ba368f4758b3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2017-01-111-1/+1
|\ | | | | | | Change-Id: If797ac58344b20e8de4379343131c097247ba2f2
| * Welcome to 2017J-P Nurmi2017-01-091-1/+1
| | | | | | | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add Drawer::interactiveJ-P Nurmi2016-11-251-0/+57
|/ | | | | | | | | | [ChangeLog][Controls][Drawer] Added interactive property that specifies whether the drawer reacts to swipes. This can be used to make drawer a non-closable persistent side-bar. Task-number: QTBUG-53169 Change-Id: I00a794b5ce47b86fcb28e0db784ca0488cd13a7d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-11-151-2/+9
|\ | | | | | | Change-Id: I4a3971034d8e6daf0285c4bc9e5612b5e6cdabf1
| * Stabilize tst_drawerJ-P Nurmi2016-11-151-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test was using QTRY_COMPARE to test that the logical position of the drawer was 1.0, meaning that the drawer was assumed to be fully open. Then the test continued with touch move events and tested the logical position accordingly. The problem was that waiting (QTRY_COMPARE) for the logical position of 1.0 does not ensure that the open transition has been finished. Fuzzy compare might return true just before the transition finishes. We sent touch move events and tested the logical position accordingly, while the open transition was still running. This way, the transition ended up setting an unexpected position for the drawer in the middle of the touch move event tests. The solution is to wait for the opened() signal to ensure that the transition has been finished, before continuing to test touch move events. Change-Id: Ia48f4cedc97c09bb1ee064f3b535ad4fc7ae5c71 Task-number: QTBUG-56061 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-10-311-1/+1
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/CheckIndicator.qml src/imports/controls/RadioIndicator.qml src/imports/controls/RangeSlider.qml src/imports/controls/Slider.qml src/imports/controls/SwitchIndicator.qml Change-Id: I32612d2f905ffa02dbaedbb1f84c8237fbd66db3
| * QQuickPopup: fix binding loops with size-dependent positioningJ-P Nurmi2016-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | Dependencies between popup's size and position easily lead to recursion into reposition(). Blocking recursive reposition() calls messes up the positioning, so schedule polish events instead. Task-number: QTBUG-56755 Change-Id: I72afd14573e5cd57f8162df04e193d4c42fd7236 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Make hoverEnabled propagate to childrenJ-P Nurmi2016-10-171-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hover effects can be sometimes a bit disturbing. This change makes it possible to conveniently disable hover effects for a tree of controls in one go. For example, to disable hover effects for a page including its header, footer, and all list items: Page { hoverEnabled: false header: ... footer: ... ListView { delegate: ... } } [ChangeLog][Controls][Important Behavior Changes] Control::hoverEnabled has been made to inherit to children, to make it possible to disable hover effects for a tree of controls in one place. Change-Id: Ia87144f2cc04957a32f89d3313816b91d97db635 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: J-P Nurmi <jpnurmi@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-09-261-0/+47
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: examples/quickcontrols2/gallery/gallery.qrc src/imports/controls/doc/src/qtquickcontrols2-styles.qdoc src/quicktemplates2/qquickstackview_p.cpp src/quicktemplates2/qquickstackview_p_p.h tests/auto/controls/data/tst_stackview.qml Change-Id: If451fe0e5653572d305b4de90a6d5cb878463e8d
| * Fix QQuickOverlay::childMouseEventFilter() to release the grabber popupJ-P Nurmi2016-09-231-0/+38
| | | | | | | | | | | | Change-Id: Id9d844d1fc75f4d254abaf1681747b7b521e881b Task-number: QTBUG-56131 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Drawer: allow interaction outside modal background dimmingJ-P Nurmi2016-09-231-0/+9
| | | | | | | | | | | | | | | | | | If a drawer is positioned below a toolbar, for instance, it must be possible to interact with the buttons in the toolbar while the drawer is open (without the drawer closing due to the interaction). Change-Id: I5e07f66ad997ba6cf991a26fc6849ec51c9c0a22 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-221-8/+129
|\| | | | | | | Change-Id: I37aab846346692fd4bff08b0dbab66db3a8e2716
| * QQuickDrawer: allow resizing and positioningJ-P Nurmi2016-09-211-8/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make QQuickDrawer re-use QQuickPopup's reposition() implementation. This way QQuickDrawer gains support for proper positioning and margins "for free". Now it is possible to place Drawer below the window header, for instance: import QtQuick 2.0 import QtQuick.Controls 2.0 ApplicationWindow { id: window visible: true header: ToolBar { } Drawer { y: header.height width: window.width * 0.6 height: window.height - header.height } } [ChangeLog][Controls][Drawer] Made it possible to control the vertical position of a horizontal drawer, and vice versa. This allows placing a drawer below a header/toolbar, for instance. Task-number: QTBUG-55360 Change-Id: I63621195efeefa2ea88935d676771b392e0a4030 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Drawer: reparent to the overlay by defaultJ-P Nurmi2016-09-211-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Drawer is a special type of popup that always resides at one of the window edges. Therefore it makes sense for drawers to operate on window coordinates. Re-parenting drawers to the window overlay achieves that. Now that the window overlay is guaranteed to always exist and the ApplicationWindow.overlay attached property works even with plain QML Window, we can reliably use it as a parent for Drawer. Task-number: QTBUG-53168 Change-Id: I37c727001350217ea1d2d9c52d73b4cae44d7c8d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Drawer: fix drag to close from the outside on touchJ-P Nurmi2016-09-191-0/+58
|/ | | | | | | | | | | | | | | Set mouseGrabberPopup in QQuickOverlay::childMouseEventFilter() the same way it is set in QQuickOverlay::mousePressEvent() to ensure that the consequent mouse move events are routed to the appropriate popup. This worked with "genuine" mouse move events that were caught by the same child mouse event filter and that way routed to the appropriate popup, but not with "synthesized" mouse move events that are caught by QQuickOverlay::mousePressEvent() instead. Change-Id: Ic59afd85e55c13ebec482bc4dc534accd1f92b2c Task-number: QTBUG-56010 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix modal overlays leaking wheel events throughJ-P Nurmi2016-09-131-0/+88
| | | | | | Change-Id: I1a3be5ef02cf73a153cebc030313f892fbb03d9f Task-number: QTBUG-55769 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: fix the internal transition stateJ-P Nurmi2016-09-061-0/+102
| | | | | | | | | | | | | | When QQuickDrawer was visible all the time, it did not emit the visibility related signals at all. Now the signals are emitted, but aboutToShow() and visibleChanged() were emitted twice when a drawer was manually dragged open. First time when the dragging begins (the drawer becomes effectively visible), and second time when the open transition begins after mouse/touch release. This change ensures that the signals won't be emitted again when the transition begins, in case they were already emitted. Change-Id: I2a175c9e86a480d5cd23e306f41f0d85e2416f75 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix drawer visibility and overlay event handlingJ-P Nurmi2016-09-061-3/+178
| | | | | | | | | | | | | | | | | | | | | | | | | | Drawers were visible all the time, lurking at the window edges to be able to catch presses and drag themselves visible when appropriate. This change moves the handling of window edge presses from QQuickDrawer to QQuickOverlay, making it possible to show and hide drawers like any other popups. Instead of having all drawers visible all the time, we just keep QQuickOverlay visible when there are any registered drawers, even hidden ones. Furthermore, this change makes modal popup/drawer background dimming items accept mouse press events just like they accept hover events to ensure that a modal overlay does not leak input events through. When the background dimming of a modal drawer has been dragged over the drag-threshold, the drawer simply steals/grabs mouse to start dragging of the drawer. Task-number: QTBUG-54794 Task-number: QTBUG-54800 Task-number: QTBUG-55022 Task-number: QTBUG-55703 Task-number: QTBUG-55713 Change-Id: I65fb38fcf1466d4e41192c4321d80fb90b49da9a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix hover event delivery with plain QQuickWindowJ-P Nurmi2016-09-051-7/+11
| | | | | | | | | | A plain QQuickWindow cannot provide a modal background dimming visual, but we can create a QQuickItem as a fallback to take care of blocking the hover events for modal popups. Change-Id: I3ead985c4e2e030aaf28f1ec6c8a1ae285637819 Task-number: QTBUG-54913 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* auto tests: allow using QQuickWindow with QQuickApplicationHelperJ-P Nurmi2016-09-051-10/+10
| | | | | | | | This allows us to run the relevant popup tests for both QQuickWindow and QQuickApplicationWindow. Change-Id: I14b6435afeeb8a6cf640d8c52ad1d9e1fae070b0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix tst_Drawer::dragMargin()J-P Nurmi2016-09-051-6/+10
| | | | | | | | | | | | | | | | | | | | | | | The width of the window in the test is 400px, and the width of the drawer is 200px. The default drag margin equals to QStyleHints::startDragDistance(), which reports 19px on Linux installed on a Chromebook Pixel 2. The test attempts to drag from (double drag margin): 2 x startDragDistance = 38px to: 0.25 x width of the drawer = 50px 12px does not exceed the start drag distance of 19px, so the drawer is not dragged even though the test expects it to be dragged to the logical position of 0.25. Increase the dragged distance a bit to exceed the threshold. Change-Id: Id469533b08c4221430446a2d995e36b4ebdc0258 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: fix velocity calculationJ-P Nurmi2016-09-021-0/+3
| | | | | | | | Use the vertical velocity for top and bottom edges, and invert the speed for right and bottom edges. Change-Id: I362dda23f0a2cda60ad7cd52e7373d0707feea83 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix hover event handling for drawer overlaysJ-P Nurmi2016-07-221-0/+64
| | | | | | | | | | Closed drawers sit visible at the window edge to be able to pull them out. Don't block hover events when drawers are fully closed ie. when their overlays are fully translucent. Task-number: QTBUG-53419 Change-Id: I5bdbed5a2cf3ad6972634432ac79f7fbe5054b98 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Drawer: reposition when closedJ-P Nurmi2016-07-061-0/+25
| | | | | | | | | A drawer must be repositioned even when closed, or else it will peek out when anchored to the right or bottom edge and the window is resized. Change-Id: Idf86ec1d841cfcc333eb6c69d07b3e4b2b4015da Task-number: QTBUG-54578 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add Drawer::dragMarginJ-P Nurmi2016-04-211-0/+60
| | | | | | | | | Allows controlling "sensitivity" of the edge drag, or disabling (dragMargin<=0) the entire drag operation if preferred. Change-Id: Icfe6f186704ca7f11abc66abeec603f29345af98 Task-number: QTBUG-52730 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* Fix QQuickDrawerPrivate::positionAt()J-P Nurmi2016-04-211-0/+95
The position on the right and bottom edges is relative to the size of the window, not the drawer itself. Change-Id: Ia1d7418d4091a3a9e26f691bd75448023e0ca1cf Reviewed-by: J-P Nurmi <jpnurmi@qt.io>