aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickdrawer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Templates: use C++11 default member initializationJ-P Nurmi2018-05-041-9/+4
| | | | | | | | | | | The code is more readable and less error-prone (this patch caught a few uninitialized members) when the members are initialized in the same place where they are declared. In many cases, empty default destructors can be entirely removed, and we get faster implicitly declared inline default constructors defined by the compiler. Change-Id: I14c5448afc901f9b2ac5965f28c1c26c0b646c08 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: fix draggingv5.11.0-beta2J-P Nurmi2018-03-091-8/+10
| | | | | | | | | | Make sure to respect keepMouse|TouchGrab. This fixes dragging a horizontal Slider inside a Drawer on the left or right edge, for example. Task-number: QTBUG-66637 Change-Id: Ie3688744741378694f96abc608dad2630ecd1fb0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2018-01-101-0/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/BusyIndicator.qml src/imports/controls/CheckBox.qml src/imports/controls/CheckDelegate.qml src/imports/controls/ComboBox.qml src/imports/controls/DelayButton.qml src/imports/controls/Dial.qml src/imports/controls/ItemDelegate.qml src/imports/controls/MenuItem.qml src/imports/controls/RadioButton.qml src/imports/controls/RadioDelegate.qml src/imports/controls/SwipeDelegate.qml src/imports/controls/Switch.qml src/imports/controls/SwitchDelegate.qml src/imports/controls/doc/src/qtquickcontrols2-configuration.qdoc src/imports/controls/material/CheckDelegate.qml src/imports/controls/material/ItemDelegate.qml src/imports/controls/material/MenuItem.qml src/imports/controls/material/RadioDelegate.qml src/imports/controls/material/SwipeDelegate.qml src/imports/controls/material/SwitchDelegate.qml src/imports/controls/qquickdefaultbusyindicator.cpp src/imports/controls/qquickdefaultbusyindicator_p.h src/imports/controls/qtquickcontrols2plugin.cpp src/imports/controls/universal/CheckDelegate.qml src/imports/controls/universal/ItemDelegate.qml src/imports/controls/universal/MenuItem.qml src/imports/controls/universal/RadioDelegate.qml src/imports/controls/universal/SwipeDelegate.qml src/imports/controls/universal/SwitchDelegate.qml src/quickcontrols2/quickcontrols2.pri src/quicktemplates2/qquickcontrol.cpp src/quicktemplates2/qquickmenu.cpp src/quicktemplates2/qquickpopup_p.h Change-Id: Ib25c8b4a7fe018b7c0ade9b02bfaaa6980118c15
| * Doc: update code snippet to add some content to the DrawerMitch Curtis2017-12-221-0/+5
| | | | | | | | | | | | Task-number: QTBUG-60550 Change-Id: I14c4d0343e2b02180bbce0546a69a7241ee6008e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2017-11-061-0/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickabstractbutton_p.h src/quicktemplates2/qquickbuttongroup_p.h src/quicktemplates2/qquickrangeslider.cpp src/quicktemplates2/qquickrangeslider_p.h src/quicktemplates2/qquickswipeview_p.h src/quicktemplates2/qquicktextarea.cpp src/quicktemplates2/qquicktextarea_p.h src/quicktemplates2/qquicktextfield_p.h Change-Id: I7cba8783b1dd85a4db534222e36572ee05dd01d0
| * Doc: mention the Side Panel example in Drawer's detailed descriptionJ-P Nurmi2017-11-031-0/+5
| | | | | | | | | | | | Task-number: QTBUG-64099 Change-Id: I6580f1779e2863e25980968b076f342a5d76d423 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2017-09-111-2/+26
|\| | | | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquicklabel.cpp src/quicktemplates2/qquicktextarea.cpp src/quicktemplates2/qquicktextfield.cpp Change-Id: Ibbf6bc48972f58fbc6779a87ac9e2434c56c4db8
| * Fix non-modal drawer drag/swipe open and closeMichal Policht2017-09-061-1/+25
| | | | | | | | | | | | | | | | | | | | 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>
| * Android: fix clang compilation with -qreal floatVyacheslav Koscheev2017-09-011-1/+1
| | | | | | | | | | Change-Id: Ica7a417aa1bb531bc63e3fa9dda0505a6e552b67 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-07-211-2/+2
|\| | | | | | | Change-Id: Idb1895dae2870dbed860ba3106fe52b01d733504
| * QQuickDrawer: fix multi-touch leaking through modal overlayJ-P Nurmi2017-07-141-2/+2
| | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-07-111-5/+20
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf tests/auto/controls/data/tst_scrollindicator.qml Change-Id: I1f5581ae7814c0d4152e4c9b79a30a8af5a3a17b
| * Drawer: ignore and warn about invalid edge valuesMitch Curtis2017-07-071-5/+20
| | | | | | | | | | | | | | | | | | This fixes an issue where an application would crash when opening a drawer by dragging it after an invalid edge value had been set. Task-number: QTBUG-61843 Change-Id: Ie9b9ea0276b356b92927b858f2be355bfc042afb Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Move visual overlay background management to QQuickPopupJ-P Nurmi2017-06-231-0/+10
|/ | | | | | | | | | | | | | During the early days, there was only one visual overlay background dimmer, so QQuickOverlay was the natural choice to manage it. It was soon realized that multiple modal popups and drawers needed each their own background dimming. Now the implementation becomes simpler when each popup manages its own background dimming. This paves the road for the upcoming changes making it possible to provide background dimming without ApplicationWindow. Task-number: QTBUG-61336 Change-Id: I621db4efe4aa74c147f81f7aee8affebddb00d49 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Let users disable the multi-touch supportJ-P Nurmi2017-06-071-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | The newly added multi-touch support can create issues, especially together with Flickable that is unfortunately still not properly touch-compatible. The implementation is still based on synthesized mouse events, so things like Flickable::pressDelay that intercepts mouse presses and re-sends sends them after a delay, does not play well with touch-enabled controls. The easiest way we can disable the whole thing is to make multi- touch support a configurable feature, the same way hover support is. ./configure -no-feature-quicktemplates2-multitouch [...] Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... no [ChangeLog][Templates] Added a configure feature for disabling multi- touch support (configure -no-feature-quicktemplates2-multitouch). Task-number: QTBUG-61144 Change-Id: I0003ae925c2a499ecb3e2a5b720088bd963d9ad3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.9.0' into 5.9Liang Qi2017-05-311-2/+5
|\ | | | | | | Change-Id: Iba044084bf82f6b2b8ceba4aa2a80bdcf8fc38e0
| * Drawer: fix dragging from the inside over interactive contentsJ-P Nurmi2017-05-081-2/+5
| | | | | | | | | | | | Task-number: QTBUG-60598 Change-Id: I65e6e9440c9450fbec4a53b9ee60e11b919c090a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Doc: add the Qt version to "\since QtQuick.Controls 2.x"J-P Nurmi2017-05-301-1/+1
|/ | | | | Change-Id: Ia7f237cb580bf9c332ff4741569a57fef4eb6079 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add QQuickDrawerPrivate::offsetAt()J-P Nurmi2017-05-021-10/+13
| | | | | | | Share the duplicated logic in grabMouse() and grabTouch(). Change-Id: If53dd5dd4302009594548e94bcc5f95b352e1bf6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Drawer: fix drag-over-threshold calculationJ-P Nurmi2017-05-021-4/+8
| | | | | | | | | | 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>
* Promote pressPoint to QQuickPopupJ-P Nurmi2017-04-281-4/+1
| | | | | Change-Id: I5aac904b7fb9397f799817ccaf5e0eb04b0129a9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add QQuickPopupPrivate::contains() for convenienceJ-P Nurmi2017-04-281-5/+5
| | | | | | | This logic seemed to be repeated in several places... Change-Id: I3b74140c7d7e44fa6ada12cf7844d96086d99e47 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: fix flicking inside drawersJ-P Nurmi2017-04-281-3/+3
| | | | | | | | 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>
* QQuickDrawerPrivate::startDrag(): start delivering touch eventsJ-P Nurmi2017-04-271-16/+19
| | | | | Change-Id: If483f0787568c18712fe0d2068d26709e6dd012d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Enable touch events for popups and drawersJ-P Nurmi2017-04-261-9/+56
| | | | | Change-Id: Icc0a496facdc2ada1c87b4b02c49a58cb9a4daec Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Revise the press/move/release handlersJ-P Nurmi2017-04-261-10/+18
| | | | | | | | | | | | Otherwise the handlers are not able to control whether presses, moves and releases should be blocked or not. a) outside a non-modal popup, b) to popup children/content, or b) outside a modal popups's background dimming Change-Id: I637295fc3122cdcddb7727ec3939ec6a68a3cf98 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Eradicate QQuickDrawerPrivate::handleMouseMoveEvent()J-P Nurmi2017-04-251-42/+31
| | | | | Change-Id: I4759baa3691498fce8c291cbb0d3f77e9e2fd8d6 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: move mouse/touch press handling to handlePress()J-P Nurmi2017-04-251-23/+2
| | | | | | Change-Id: I8744525e1f185fa1e58d9e5d81f233a3aad3b2e1 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Simplify QQuickDrawerPrivate::startDrag()J-P Nurmi2017-04-251-28/+10
| | | | | | | | | | | | | | The purpose is to calculate whether a press is within the drag margin ie. whether a drawer can start dragging. There seems to be no reason to call the clumsy QQuickWindowPrivate::dragOverThreshold() method, which is different for mouse and touch events. In addition to the start drag distance, it actually calculates start drag velocity too, which is entirely irrelevant for us. Instead, we can do ourselves a very simple mouse vs. touch agnostic calculation whether a press lands within the drag margin. Change-Id: I356a349fdef3df1455715ae7572dbcb9e8100f93 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: move mouse/touch release handling to handleRelease()J-P Nurmi2017-04-251-84/+66
| | | | | Change-Id: I279fe0a0c77e482a414424f90827e85a91df221a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: override handlePress/Move/Release/Ungrab()J-P Nurmi2017-04-251-12/+27
| | | | | Change-Id: Id947e868aa1c89aaab0cb6988b76f0cfe25d8339 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Pass timestamp to QQuickPopupPrivate::handlePress/Move/Release()J-P Nurmi2017-04-251-3/+3
| | | | | | | QQuickDrawer needs the timestamp to calculate velocity. Change-Id: I1ab5fc2e492948a424a8c56e4b9788fc3d489333 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickPopup: tryClose() via handlePress() & handleRelease()J-P Nurmi2017-04-251-8/+5
| | | | | | | | | This is a preparation step to make Drawer compatible with touch events. It will eventually override handlePress/Move/Release() to deal with both touch and mouse input. Change-Id: I8ae21f6909ca51f86f19dbe68a3e820e9af676ab Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawer: don't jump when dragging openJ-P Nurmi2017-04-241-1/+9
| | | | | | | | | | | | | | | | 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>
* QQuickDrawer: allow passing a touch event to startDrag()J-P Nurmi2017-04-211-23/+52
| | | | | | Task-number: QTBUG-58389 Change-Id: I4fbdcc2ff4e45a4cbda3e4904c610ab1b269cba3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickDrawerPrivate::startDrag(): remove superfluous argumentJ-P Nurmi2017-04-211-1/+1
| | | | | | | | | | Popups used to have a valid window-pointer only when they were visible, but now the window is automatically looked up from the parent item. There is no need to pass the window pointer from the overlay anymore, because the drawer already knows the window. Change-Id: I9652607217a82af2be89f6ab4490431556e3d17c Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickPopup: implement tryClose() for touch eventsJ-P Nurmi2017-04-211-2/+2
| | | | | | Task-number: QTBUG-58389 Change-Id: I40aef785cabda228f19c74a064187df509aa9916 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Prepare QQuickPopup for touch event handlingJ-P Nurmi2017-04-211-0/+8
| | | | | | | | | Add acceptTouch() and handlePress/Move/Release/Ungrab() to QQuickPopupPrivate, similarly to the recent changes to QQuickControl. Task-number: QTBUG-58389 Change-Id: I45bc0c51f7db79d0d3291f4beee6dab45b158e8a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Re-format constructorsJ-P Nurmi2017-01-191-2/+2
| | | | | | | | | | | It was a bit inconsistent before. Admittedly the colon at the end was the most commonly used style in the quicktemplates2 code base, but some had a line-break before the colon. This is now chosen as the one true coding style of QQC2. ;) It makes the initializer list aligned so that it stands out from the constructor body. Change-Id: I66835e088df90d7219af04915176006d2a934ddc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Format initializer listsJ-P Nurmi2017-01-191-1/+3
| | | | | | | | Initialize one member per line. Allow empty constructors with one initialized member on a single line. Change-Id: Ie115802561ebd19efd4dacda1fa868b64d279109 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-2/+32
| | | | | | | | | | | | | | | | | | | | [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.8' into devJ-P Nurmi2016-11-031-10/+6
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/BusyIndicator.qml src/imports/controls/ProgressBar.qml src/quicktemplates2/qquickpopup.cpp src/quicktemplates2/qquickpopup_p_p.h src/quicktemplates2/qquickstackview.cpp Change-Id: I9a1028a991de9fc3e26d3f973106301e9ada631c
| * Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-11-021-10/+6
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/Drawer.qml src/imports/controls/Frame.qml src/imports/controls/GroupBox.qml src/imports/controls/Page.qml src/imports/controls/Pane.qml src/imports/controls/ToolBar.qml src/imports/controls/Tumbler.qml src/quicktemplates2/qquickapplicationwindow.cpp src/quicktemplates2/qquickpopup.cpp tests/auto/accessibility/data/busyindicator.qml tests/auto/accessibility/data/button.qml tests/auto/accessibility/data/checkbox.qml tests/auto/accessibility/data/control.qml tests/auto/accessibility/data/dial.qml tests/auto/accessibility/data/label.qml tests/auto/accessibility/data/menu.qml tests/auto/accessibility/data/pageindicator.qml tests/auto/accessibility/data/popup.qml tests/auto/accessibility/data/progressbar.qml tests/auto/accessibility/data/radiobutton.qml tests/auto/accessibility/data/rangeslider.qml tests/auto/accessibility/data/scrollbar.qml tests/auto/accessibility/data/scrollindicator.qml tests/auto/accessibility/data/slider.qml tests/auto/accessibility/data/spinbox.qml tests/auto/accessibility/data/switch.qml tests/auto/accessibility/data/tabbar.qml tests/auto/accessibility/data/tabbutton.qml tests/auto/accessibility/data/textarea.qml tests/auto/accessibility/data/textfield.qml tests/auto/accessibility/data/toolbar.qml tests/auto/accessibility/data/toolbutton.qml tests/auto/accessibility/tst_accessibility.cpp Change-Id: Ibc3f592162e97bef9147b35da8c9a79e73a907e6
| | * Doc: revise brief descriptionsJ-P Nurmi2016-11-021-1/+1
| | | | | | | | | | | | | | | | | | Change-Id: If7bdd4c11aaeb2df87622c769b1a65ac82ac7e73 Task-number: QTBUG-55904 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * Doc: add GIF animation for DrawerJ-P Nurmi2016-11-011-10/+6
| | | | | | | | | | | | | | | | | | Change-Id: Ib4c8b5f80e63a322c20caa837632739a3bfee3ee Task-number: QTBUG-55904 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2016-10-311-8/+10
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickpopup.cpp src/quicktemplates2/qquickpopup_p_p.h Change-Id: I33241dfd15a320e6ae2f0c056252b0ec6be7c6f6
| * | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-10-311-8/+10
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| | * Doc: fix review findings for DrawerJ-P Nurmi2016-10-281-8/+10
| | | | | | | | | | | | | | | | | | Change-Id: Ibdf3f1dee5664979cdf77ba7485e3d71110fc860 Task-number: QTBUG-55904 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>