aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickdrawer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-221-20/+20
| | | | | | | | | | | This reverts commit 950f8bff7cbbdbd472234fd32ef659c9d0e8ba7c. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: I69e514934864bea3ccd68de9a65fb08e262325a1 Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
* Update commercial license headersTarja Sundqvist2021-01-221-20/+20
| | | | | | | | | | | | | | | Updated header.COMM to files in tqtc-qtquickcontrols2. Examples, tests or documentation files are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4209 Change-Id: I4175d7a58cb1b04172132a3bc09aea1b065d1778 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Don't trigger a close due to a release if we did not get a pressAndy Shaw2020-09-181-0/+2
| | | | | | | | | | | | If the drawer does not see the press point then it was not open at the time it was pressed. This ensures that when a touch is done on a button to trigger the opening of a drawer it does not think it should be closed due to the default close policy. Change-Id: I0d1b11341e659dc14554d0d72aac70199bbb99fa Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit d3cc8710bc6175e5e7562ba171bd32dfc4d224b7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Fix qdoc warningsVenugopal Shivashankar2019-11-261-1/+1
| | | | | | | | | | | The warnings were about: - Undocumented function parameters - Instances of \instantiates that us an internal class - A few link issues Task-number: QTBUG-79827 Change-Id: I60094279c7da6bc446b5c63b7b4924b71cee4672 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Drawer: fix infinite positioning loopMitch Curtis2019-02-221-0/+3
| | | | | | | | | This fixes the issue where Drawer would try to reposition itself forever, but does not address the fact that it is incorrectly positioned afterwards. Task-number: QTBUG-71290 Change-Id: Ibbd4baa84b66ab446ce3af2ef326f8c50e74216d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Tie minor version of all imports to Qt's minor versionMitch Curtis2018-11-021-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change makes all Qt Quick Controls 2 imports match the current Qt minor version, which is 12 as of this patch. It also updates all other Qt Quick imports to match. This will also make future version bumps easier as all version numbers in existing code/docs will match. The following commands were used to verify that no old versions remain: for i in `seq 0 11`; do git grep "import QtGraphicalEffects.*1.$i$"; done for i in `seq 0 11`; do git grep "import QtQuick 2.$i$"; done for i in `seq 0 11`; do git grep "import QtQuick.Layouts 1.$i$"; done for i in `seq 0 5`; do git grep "import QtQuick.Controls.*2.$i$"; done for i in `seq 0 11`; do git grep "import QtQuick.Templates 2.$i as T$"; done [ChangeLog] From Qt 5.12 onwards, all import versions in Qt Quick Controls 2 follow the same minor version as Qt's minor version number. For example, the import version for Qt 5.12 is: "import QtQuick.Controls 2.12". Change-Id: I6d87573f20912e041d9c3b7c773cc7bf7b152ec3 Fixes: QTBUG-71095 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-071-9/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickabstractbutton_p_p.h src/quicktemplates2/qquickcombobox.cpp src/quicktemplates2/qquickcontainer.cpp src/quicktemplates2/qquickcontrol.cpp src/quicktemplates2/qquickcontrol_p_p.h src/quicktemplates2/qquickdialog_p_p.h src/quicktemplates2/qquickdialogbuttonbox.cpp src/quicktemplates2/qquickdialogbuttonbox_p_p.h src/quicktemplates2/qquickdrawer.cpp src/quicktemplates2/qquickmenubar.cpp src/quicktemplates2/qquickmenubar_p_p.h src/quicktemplates2/qquickpage.cpp src/quicktemplates2/qquickpage_p_p.h src/quicktemplates2/qquickpane.cpp src/quicktemplates2/qquickpane_p_p.h src/quicktemplates2/qquickpopup.cpp src/quicktemplates2/qquickpopup_p_p.h src/quicktemplates2/qquickrangeslider.cpp src/quicktemplates2/qquickscrollview.cpp src/quicktemplates2/qquickslider.cpp src/quicktemplates2/qquickspinbox.cpp src/quicktemplates2/qquickswipeview.cpp src/quicktemplates2/qquicktabbar.cpp src/quicktemplates2/qquicktextarea_p_p.h src/quicktemplates2/qquicktextfield_p_p.h src/quicktemplates2/qquicktheme_p.h Change-Id: I6e2b8fe99e51e3e26c87546aa66af045bc429ec4
| * 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>
* | Replace QQuickDrawerPrivate::reposition() with QQuickDrawerPositionerJ-P Nurmi2018-05-021-4/+23
|/ | | | | Change-Id: I64567cf88b14d407e4888b8c2ae921322af0e154 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>