aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickswipedelegate.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QQuickSwipePrivate: parent delegate context to controlMitch Curtis2017-03-241-1/+1
| | | | | | | | | This fixes a crash in QQuickSwipeDelegatePriavte's destructor when using QML debugging. Task-number: QTBUG-59532 Change-Id: I55f97039eb723652fec24e4c3a8ce5d1a8fb6c41 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Port from QT_NO_ACCESSIBILITY to QT_CONFIG(accessibility)J-P Nurmi2017-02-241-1/+1
| | | | | Change-Id: I03deebff661746d49e537af5b1c8899b938efb0d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Re-format constructorsJ-P Nurmi2017-01-191-12/+9
| | | | | | | | | | | 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-15/+15
| | | | | | | | 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>
* QtQuickControls2: Use the newly-introduced qmlWarning instead of qmlInfoRobin Burchell2017-01-131-6/+6
| | | | | | | | qmlInfo will shortly be returning info-level messages (as the name hints), rather than warning level messages. Change-Id: I94123464b12b30a4ba085cfb7b606bc26df9b76e Reviewed-by: Simon Hausmann <simon.hausmann@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>
* | SwipeDelegate: rename swipe.rebound to swipe.transitionJ-P Nurmi2016-12-211-22/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "rebound" name originates from Flickable::rebound, but for swipe delegate the transition is not only applied on release, but also when calling swipe.open() or swipe.close(). Therefore the "rebound" name feels a bit off in this context. Furthermore, this patch adds the missing docs and a changelog entry. [ChangeLog][Controls][SwipeDelegate] Added a swipe.transition property that holds the transition that is applied when a swipe is released, or swipe.open() or swipe.close() is called. Change-Id: Ic38ec850c64dd21b8d9deb08609172c6cb0f6d71 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Doc: SwipeDelegate: document grouped signals with \qmlsignalJ-P Nurmi2016-12-201-29/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes them appear in the list of signals at the top of the documentation. The same was done for methods earlier. a506a0ac added the swipe.opened() and swipe.closed() signals but missed a changelog entry: [ChangeLog][Controls][SwipeDelegate] Added swipe.opened() and swipe.closed() signals, which are emitted when the delegate has been opened or closed by swipe, and the respective transition has finished. Change-Id: Iacd2befc691ab7ed8209736595d8ad98e86e637a Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Add "Swipe to Remove" exampleJ-P Nurmi2016-12-201-1/+1
| | | | | | | | | | Change-Id: Ibab960ddd073ddcdfbf2b6e4492882662c7021b5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | SwipeDelegate: add swipe.opened() and swipe.closed() signalsJ-P Nurmi2016-12-141-32/+68
| | | | | | | | | | | | | | | | Emitted when the delegate has been opened or closed by swipe, _and_ the respective transition has finished. Change-Id: I8a242e24352d311fd8b41ceafd0a36619eff73f2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | SwipeDelegate: transition swipe.positionJ-P Nurmi2016-12-141-12/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the value of swipe.position jumped on mouse/touch release, or when open() or close() was called. Transitioning the swipe.position value smoothly to the target value makes it possible to use it as opacity/scale/etc. for the side items. Notice that this is backwards compatible with the old behavior. If no transition is set, the value jumps the same way it did before. In that case, Behavior on x makes the movement smooth. Task-number: QTBUG-57242 Change-Id: Id9c06b5b08fa73f2f575787e16dc6e20e4ccb545 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devJ-P Nurmi2016-12-011-0/+15
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/SpinBox.qml src/imports/controls/material/SpinBox.qml src/imports/controls/universal/SpinBox.qml tests/auto/controls/data/tst_swipedelegate.qml Change-Id: Ie1d1f487890f0a9f80a00df5e813e1d2e8303fe5
| * Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-12-011-0/+15
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/controls/data/tst_swipedelegate.qml Change-Id: I15bd0366f1ad0ce35f1dce6d790da6dd5f0221f9
| | * SwipeDelegate: fix animations when releasing from a drag5.7Mitch Curtis2016-11-301-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9812a9c changed the order in which the pressed and position state is set. Before, when releasing after swiping, it would be: set pressed to false => set position After 9812a9c, it became: set position => set pressed to false The original order is necessary to ensure that animations can rely on being enabled *before* position changes, as their enabled expression typically looks something like this: enabled: !control.down This patch duplicates the contents of QQuickAbstractButton::mouseUngrabEvent() for now, with a TODO comment to ensure that it's moved into a private helper that we can call later on. Task-number: QTBUG-57350 Change-Id: I31af7a665fb2d0e37548df31560ed7bbb0c3cadb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | | Add SwipeDelegate::swipe.open()J-P Nurmi2016-11-251-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows nice tricks, such as opening the swipe on click to expose more details for clicked delegates. [ChangeLog][Controls][SwipeDelegate] Added swipe.open(side) method that can be used to programmatically open the side item on the specified side, which can be either SwipeDelegate.Left or SwipeDelegate.Right. Change-Id: I64000e41ef62e04bf11a3819e03353c3ae4690cb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | SwipeDelegate: Add swipe.enabled propertyMitch Curtis2016-11-251-1/+34
|/ / | | | | | | | | | | | | | | | | [ChangeLog][Controls][SwipeDelegate] Added swipe.enabled property to allow disabling of swiping. Task-number: QTBUG-57192 Change-Id: I733336690368ea3fb56a144a335a37e60a02f1b9 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | SwipeDelegate: fix swipes that begin over a child item of a delegateMitch Curtis2016-11-241-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | If the mouse was pressed over a child item of the delegate, the event's position will be for that item, rather than the entire control. To fix this, we need to set the correct pressPoint. To avoid duplicating QQuickAbstractButton::mousePressEvent()'s code, we simply set the correct pressPoint after calling it in QQuickSwipeDelegatePrivate::handleMousePressEvent(). Task-number: QTBUG-57271 Change-Id: I7204d6176c755512eeeb0b1a57a920fbab40392c Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-11-231-21/+30
|\| | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickswipedelegate_p.h Change-Id: I5446503c1e4f21cb37f4fffeb3453d1c84b54b30
| * SwipeDelegate: don't emit clicked when released outsideMitch Curtis2016-11-231-21/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there are no delegates and hence the mouse hasn't been grabbed, we should clear the pressed state when the mouse is dragged outside the control. We can do so by falling back to the event handling of the base class (QQuickItemDelegate) when we have no delegates. This also ensures that the canceled() signal is emitted. A similar thing is done for controls with delegates, except that only the vertical position of the mouse is checked, as we still want to initiate swipes horizontally. Change-Id: I7738f5b9e8e8b6ce4a733008fa4ff73596e854ea Task-number: QTBUG-56312 Task-number: QTBUG-57285 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | SwipeDelegate: fix broken swiping after calling SwipeDelegate.close()Mitch Curtis2016-11-221-0/+4
| | | | | | | | | | | | | | | | | | Reset the internal state when close() is called to ensure that it's consistent. Task-number: QTBUG-57243 Change-Id: Id52724e0eb296c3f8a4fc0a0587a04558b1d1ab6 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-11-021-6/+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: mention that some SwipeDelegate::swipe properties are read-onlyJ-P Nurmi2016-10-311-5/+5
| | | | | | | | | | | | Change-Id: Ie9eeecc73cd3fa6d4fd8aa17abb38c4dc03f2024 Task-number: QTBUG-55904 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Doc: fix SwipeDelegate detailed descriptionJ-P Nurmi2016-10-251-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The latest 5.7->5.8 merge messed up the detailed description of SwipeDelegate. In 5.7, the snippet was moved from the bottom to the top, but after the merge both were there. Also, the qdoc marker ('1' vs. 'file') did no longer match what was in the snippet file: warning: Command '\snippet (//! [file])' failed at end of file 'qtquickcontrols2-swipedelegate.qml' Change-Id: I77411b737fe0b95e6096a89bd3199bacc2d1c2ae Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-191-3/+9
|\| | | | | | | | | | | | | | | Conflicts: src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml src/imports/controls/material/qquickmaterialstyle.cpp Change-Id: I00b533e28407f87a31588e92109a468a5bfb4cc8
| * SwipeDelegate: fix documentation review findingsMitch Curtis2016-10-171-3/+9
| | | | | | | | | | | | Change-Id: I8ff60306fac53abefde6d8e9fe7727036f264799 Task-number: QTBUG-55904 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-10-071-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-progressbar-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-checked.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-radiobutton-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-first-handle-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-rangeslider-second-handle.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-disabled.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-focused.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-slider-normal.qml src/imports/controls/doc/snippets/screenshots/qtquickcontrols2-tabbar-explicit.qml src/quicktemplates2/qquickmenu.cpp tests/auto/controls/data/tst_buttongroup.qml tests/auto/controls/data/tst_swipedelegate.qml Change-Id: Ib6042a0ad716f557927e7412d17ea8957d06c015
| * SwipeDelegate: fix comment referring to code that has since been movedMitch Curtis2016-10-061-1/+1
| | | | | | | | | | Change-Id: I2d4fbb65a151a62c32a1cf1b7907bdbf4e4ae2d6 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Doc: SwipeDelegate: move methods out of property groupsJ-P Nurmi2016-08-131-9/+12
| | | | | | | | | | | | | | | | | | This is the same as 49b79522 for RangeSlider. QDoc doesn't support documenting methods inside a property group. Move them to the top level and use 'see also' to link between the group and method. Change-Id: I6af44fa44e107b62cedb38f60c04582ab4bbd299 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devJ-P Nurmi2016-08-091-0/+1
|\| | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickpage.cpp Change-Id: I4c8b62fb1d7c20c6d3c870eb47e0402a20051098
| * Add SwipeDelegate to Delegate Controls documentationMitch Curtis2016-08-081-0/+1
| | | | | | | | | | | | Task-number: QTBUG-55174 Change-Id: I28397af09d6d4134a59449c76f15ec9a65cd9b4e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-031-0/+16
|\| | | | | | | | | | | | | | | | | | | | | | | Also update expected line numbers in tst_swipedelegate. Conflicts: .qmake.conf src/quicktemplates2/qquicktextarea.cpp src/quicktemplates2/qquicktextarea_p.h tests/auto/controls/data/tst_swipedelegate.qml Change-Id: I36323e3a633c1c750d23014e56a7c881963a1a30
| * SwipeDelegate: warn about horizontally anchoring background/contentItemMitch Curtis2016-08-021-0/+16
| | | | | | | | | | | | | | | | | | SwipeDelegate must have control over the x positions of these items in order to move them during swipes. Task-number: QTBUG-55040 Change-Id: Ie1e91fa4705cffe7573205279feff9bab048acd5 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into devJ-P Nurmi2016-07-151-11/+53
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickswipedelegate.cpp tests/auto/controls/data/tst_swipedelegate.qml tests/auto/controls/data/tst_textarea.qml tests/auto/controls/data/tst_textfield.qml Change-Id: I244f4ead4d14238c41db0bd965d7a2938f2ea8fc
| * SwipeDelegate: vertically resize contentItem when swipe is completeMitch Curtis2016-07-151-4/+8
| | | | | | | | | | | | | | | | Otherwise the delegate's text doesn't change with height animations. Task-number: QTBUG-54780 Change-Id: I4e253b807e4765732a80100fca102b6650527948 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * SwipeDelegate: reposition contentItem, background on width changesMitch Curtis2016-07-121-7/+41
| | | | | | | | | | | | Change-Id: I6af4f1a4517e79f2e34b0bbca401b0eefd0c6ff4 Task-number: QTBUG-54660 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * SwipeDelegate: document which items can be used in left/right/behindMitch Curtis2016-07-111-0/+6
| | | | | | | | | | | | Task-number: QTBUG-54658 Change-Id: Ie8bb1fa6669c7dd1cd18199d01c773a1854edad4 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | SwipeDelegate: add doc exampleMitch Curtis2016-07-151-0/+5
| | | | | | | | | | | | Change-Id: I3fb5434722dd5d6cd744e3d853a5a15e52bf03d0 Task-number: QTBUG-54645 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | SwipeDelegate: add swipe.pressed and swipe.clicked()Mitch Curtis2016-07-141-3/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | These allow users to detect when non-interactive left/right/behind items are being pressed and clicked. [ChangeLog][SwipeDelegate] Added swipe.pressed and swipe.clicked() for detecting when non-interactive left/right/behind items are pressed and clicked. Change-Id: I858f0a8e4f85b3f80f93eb4f1680d8e121acdd41 Task-number: QTBUG-54651 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | SwipeDelegate: add swipe.completed() signalMitch Curtis2016-07-131-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | This allows users to respond to completion of the swipe by e.g. removing the item from the list it is in. [ChangeLog][SwipeDelegate] Added swipe.completed() for responding to completion of swipes. Change-Id: I3d605f18a1aff8892a6e088188b606a630e99506 Task-number: QTBUG-54651 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | SwipeDelegate: add swipe.close()Mitch Curtis2016-07-131-1/+15
|/ | | | | | | | | | | | This allows users to close the swipe after an action has been triggered, for example. [ChangeLog][SwipeDelegate] Added swipe.close() for setting swipe.position to 0. Change-Id: Ib12a6592ac1ba46baafd88a41ea8f297599c7bbc Task-number: QTBUG-54651 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* SwipeDelegate: only consume child events if we grabbed the mouseMitch Curtis2016-07-081-5/+7
| | | | | | Change-Id: Ie808d06824e3bbdb36111625fbb5c59ee9d4e2a4 Task-number: QTBUG-54648 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: update \sa statements ControlsNico Vertriest2016-06-081-1/+1
| | | | | Change-Id: Ifb2b62302e965a685ee57297aada883c7277610c Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: fix SwipeDelegate link errorsJ-P Nurmi2016-05-261-10/+10
| | | | | Change-Id: Ied20555722cbd91a24e3c6a183efc8c0fd06f1e3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Doc: add missing \since 5.7 tagsJ-P Nurmi2016-05-251-0/+1
| | | | | Change-Id: Ie4680c5dfadc95278215b688f4fc28577f557933 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* SwipeDelegate: rename exposure to swipe, active to completeMitch Curtis2016-05-231-132/+132
| | | | | | | | | "swipe" is both shorter and easier to understand. "complete" is easier to understand. Task-number: QTBUG-53519 Change-Id: I87ecba4ac878f033111ee56fa618b80b227858a7 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix SwipeDelegate's detailed descriptionMitch Curtis2016-05-041-2/+2
| | | | | Change-Id: I009805a46979c11b9902ccbd9ec5199530012a29 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Move highlighted to subclasses that actually use itMitch Curtis2016-04-271-2/+2
| | | | | Change-Id: I70468b35b2a3a03c6e2d557a67443291697c8b42 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Move autoRepeat out of QQuickAbstractButtonMitch Curtis2016-04-231-3/+1
| | | | | | | | Subclasses like QQuickCheckBox don't need this. Change-Id: I885442b3286b0a497ba742d4dc7df0e89f8b02e8 Task-number: QTBUG-51554 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>