aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickscrollbar.cpp
Commit message (Collapse)AuthorAgeFilesLines
* ScrollBar: fix value not changing when scrolling via VoiceOverMitch Curtis2019-04-241-1/+15
| | | | | | | | | Connect to the QQuickAccessibleAttached::increaseAction() and QQuickAccessibleAttached::decreaseAction() signals. Change-Id: I9d6b37ac68d8790edcb3d4d72f155ec8511cabe2 Fixes: QTBUG-75072 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Fix typo in ScrollBar's documentationMitch Curtis2019-03-281-1/+1
| | | | | Change-Id: I3a26f24ad16f6330715ce62151895f28e4b856d3 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Templates: use C++11 default member initializationJ-P Nurmi2018-05-041-24/+0
| | | | | | | | | | | 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>
* ScrollBar: fix infinite loopJ-P Nurmi2018-01-221-4/+6
| | | | | | | | | | | | 9e1b044 ("ScrollBar: allow configuring the minimum size") attempted to simplify QQuickScrollBarAttachedPrivate::scrollHorizontal() and scrollVertical(), but apparently the new calculation was not identical since it caused a crash with pixel delta wheel events on macOS. Revert back to the previous version, as it was before 9e1b044. Task-number: QTBUG-65784 Change-Id: I4f326c3ba67595429cfbaef491089aa83572f0de Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ScrollBar: allow configuring the minimum sizeJ-P Nurmi2017-11-031-16/+112
| | | | | | | | | | | | | | The existing size and position properties cannot be changed, because then they won't match with Flickable::visibleArea and we get major problems connecting the two. Thus, the effective visible position and size are provided as separate properties. [ChangeLog][Controls][ScrollBar] Added minimumSize, visualSize, and visualPosition properties. Task-number: QTBUG-56557 Change-Id: I923a74e5f6db7013b30fc2bef35e3d01282d5d98 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: add the Qt version to "\since QtQuick.Controls 2.3"J-P Nurmi2017-05-311-2/+2
| | | | | | | For the earlier versions, this was already done in the 5.9 branch. Change-Id: I3fd3840aca0f5aadd7aa77eba358ac0f6c94f942 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-05-301-3/+3
|\ | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickrangeslider.cpp Change-Id: I7eb990cfdc91173f86552841ba16536b35ea09cf
| * Doc: add the Qt version to "\since QtQuick.Controls 2.x"J-P Nurmi2017-05-301-3/+3
| | | | | | | | | | Change-Id: Ia7f237cb580bf9c332ff4741569a57fef4eb6079 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-04-211-74/+4
|\| | | | | | | | | | | | | | | Conflicts: src/imports/controls/RoundButton.qml src/imports/controls/universal/RadioDelegate.qml Change-Id: I4cb14c19bd5f6e19b70b03fb394c76712e6dda08
| * Override QQuickControlPrivate::handleXxx()J-P Nurmi2017-04-201-72/+4
| | | | | | | | | | | | Change-Id: I5c5be24142a758637e18df24b43847a8c6079346 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| * QQuickControl: implement focus handling on touchJ-P Nurmi2017-04-201-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickControl::focusPolicy was only managed in mousePressEvent() and mouseReleaseEvent(). All controls call the base class implementations of these event handlers to get the focus policy handling "for free". Move focus policy handling to handlePress() and handleRelease() that can be re-used for touch events, and make sure that various controls call the base class implementation of touch event handlers. There's still a bit of duplication in QQuickControl::touchEvent() and the overridden handlers in sub-classes, but this will be improved step by step. QQuickControlPrivate::handlePress/Move/Release/Ungrab() are planned to be made virtual, overridden in subclasses, and only called from QQuickControl event handlers. Most mouse and touch event handlers in QQuickControl subclasses can be removed later when we get there. Task-number: QTBUG-58389 Change-Id: I7e82dc2ef49762a005c482ce1353e03cc841659f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-04-111-0/+53
|\| | | | | | | | | | | | | Conflicts: src/quicktemplates2/qquickcontrol.cpp Change-Id: I73a9946da4214dcb8c877e716af5a8bb64335f69
| * ScrollBar: react immediately when using a mouseJ-P Nurmi2017-04-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial drag threshold is a necessary evil on touch to avoid conflicting with flickables, but leads to bad experience (QTBUG-47081) when using a mouse. Now that we have separate mouse and touch handling, we can apply immediate moves when using a mouse, but keep the old behavior on touch. [ChangeLog][Important Behavior Changes] ScrollBar now reacts immediately when using a mouse. Task-number: QTBUG-58667 Change-Id: I51759fc01dc8b8536834a8a3cca635ff512f7dc9 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * QQuickScrollBar: handle touch eventsJ-P Nurmi2017-04-101-0/+52
| | | | | | | | | | Change-Id: I0521eb36ee01abc72edc869d92910e823f00a2f2 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-04-061-2/+14
|\| | | | | | | | | | | | | Conflicts: src/imports/templates/qtquicktemplates2plugin.cpp Change-Id: I4a07d331163a85a0fb98a5f58f3970863f8da0fc
| * Set explicit cursors on all interactive controlsJ-P Nurmi2017-04-051-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | For example, if you have a floating button on top of a text editor, hovering the button must change the cursor from the editor's ibeam cursor to an arrow cursor. This applies to all interactive controls that call setAcceptedMouseButtons(). If a control blocks mouse events, it should not use some random cursor from another control underneath. Task-number: QTBUG-59629 Change-Id: I8a6ae306bbc76a9b22377361cb19cf9c3a872d31 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * QQuickScrollBar: set implicit Cursor as Qt::ArrowCursorKarol Polak2017-04-041-0/+3
| | | | | | | | | | | | | | | | Scrollbar over TextArea had Qt::IBeamCursor, although the textarea would not be activated when clicked. Task-number: QTBUG-59629 Change-Id: Ie96ba03360fcfb5872f5bb6345e168c987978aca Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | ScrollBar: add horizontal and vertical properties for convenienceJ-P Nurmi2017-03-281-0/+32
|/ | | | | | | | | [ChangeLog][Controls][ScrollBar] Added horizontal and vertical properties to make it more convenient to create orientation-dependent bindings in styles. Change-Id: Id48d17021b663f00d242ffbde06b76407b832f81 Reviewed-by: Mitch Curtis <mitch.curtis@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>
* Add "hover support" configure featureJ-P Nurmi2017-02-061-1/+8
| | | | | | | | | | ./configure -no-feature-quicktemplates2-hover [...] Qt Quick Templates 2: Hover support .......................... no Change-Id: I0509a1a9ac3ffe2cbfe4f2016ce0345708860b84 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add ScrollViewJ-P Nurmi2017-01-271-2/+13
| | | | | | | | [ChangeLog][Controls][ScrollView] Added ScrollView. Change-Id: I5d68799f0246e04b519bf6a0ec7bc7e5625f50e7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QQuickScrollBarAttached: fix change listener removalJ-P Nurmi2017-01-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before bb2a6c6 QQuickScrollBarAttached called flickable->updateOrAddGeometryChangeListener(Size) when attaching to a Flickable, and flickable->removeItemChangeListener(Geometry) when detaching from a Flickable. In bb2a6c6 the latter was changed to flickable->updateOrRemoveGeometryChangeListener(listener, Size) to make the attach and detach operations nice and symmetric. Now the problem is that updateOrRemoveGeometryChangeListener(Size) doesn't actually remove the listener, but just resets the geometry types it listens to. Thus, upon destruction of QQuickScrollBarAttached, it leaves behind a dangling pointer in Flickable's list of change listeners. We can call either of these to fix the problem: flickable->updateOrRemoveGeometryChangeListener(Nothing) flickable->removeItemChangeListener(Geometry) The former does essentially the latter with some extra overhead, so we'll just revert back to how it was before bb2a6c6. I added a warning note, also to ScrollIndicator since it's using the same approach, to avoid the same pitfall in the future. Change-Id: Ibdce15b22edf549491426d769b74b18daf0500ca Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Keep track whether ScrollBar::interactive is explicitly setJ-P Nurmi2017-01-261-7/+22
| | | | | | | | | | The upcoming ScrollView toggles between interactive and non-interactive scroll bars depending on whether it is interacted via touch or a mouse device. This allows ScrollView to check whether the user or style explicitly requested a specific mode and respect it. Change-Id: I69d21652b3a91cb9db0f76ba52adc35ccd612ab1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add QQuickScrollBarAttachedPrivate::setFlickable()J-P Nurmi2017-01-231-48/+108
| | | | | | | | | | QQuickScrollBarAttached was assuming that a QQuickFlickable instance was passed to the constructor. This patch allows specifying it after the construction, making it possible for the upcoming ScrollView to use attached scrollbars. Change-Id: I7c434734f74df65af86263f09da6a46fa68fc946 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickScrollBar: fix overshootJ-P Nurmi2017-01-201-8/+11
| | | | | | | | | | | | ScrollBar should not always force a range of 0.0-1.0, but only when interacted with. This way, the scrollbar stops at bounds when dragged, but flicking the attached Flickable respects its boundsBehavior and overshoots if appropriate. The logic and test is adapted from QQuickScrollIndicator commit 8d093a. Change-Id: Ida720d4cc2bb1de06ba0c02dfb25be51dd3108fc Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add ScrollBar::policyJ-P Nurmi2017-01-201-1/+33
| | | | | | | | [ChangeLog][Controls][ScrollBar] Added a policy-property, which holds whether the scroll bar is shown always/never/as needed (default). Change-Id: Ibe25edaef04a7926bc12c59913efa7a3d43a5ccf Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Move QQuickScrollBar(Attached)Private to a private headerJ-P Nurmi2017-01-201-74/+19
| | | | | | | To make the private classes accessible for the upcoming ScrollView. Change-Id: Iae1d7f9b136a99ac5892418c52071a902e665476 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickScrollBar: fix layouting on implicit size changesJ-P Nurmi2017-01-201-6/+24
| | | | | Change-Id: I1816926e7f23324e6143db40d7352524737c0168 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ScrollBar: fix memory leak when attached to a non-FlickableJ-P Nurmi2017-01-201-13/+10
| | | | | | | | We must pass the attachee QObject as a parent instead of passing a qobject_casted QQuickFlickable, which may be a null pointer. Change-Id: If3c785beac76ad989d12579e6d41062f4754ba2e Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Add ScrollBar::interactiveJ-P Nurmi2017-01-201-1/+32
| | | | | | | | | | | [ChangeLog][Controls][ScrollBar] Added an interactive-property. A non-interactive ScrollBar is visually and behaviorally similar to ScrollIndicator. This property is useful for switching between typical mouse- and touch-orientated UIs with interactive and non- interactive scroll bars, respectively. Change-Id: Ie98bfa0b5bba94a9751baf3c65f17b850b58fd1f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Re-format constructorsJ-P Nurmi2017-01-191-4/+4
| | | | | | | | | | | 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-4/+16
| | | | | | | | 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-1/+1
| | | | | | | | 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>
* | Add ScrollBar::snapModeJ-P Nurmi2017-01-101-4/+61
| | | | | | | | | | | | | | | | | | [ChangeLog][Controls][ScrollBar] Added snapMode property incremental or discrete scrolling. Task-number: QTBUG-56569 Change-Id: Id0d463b85063a62b7df6307af8fe8b203155a5de Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Revise QScrollBar internalsJ-P Nurmi2017-01-101-10/+47
|/ | | | | | | | Move the press/move/release/ungrab logic from mouse event handlers to QQuickScrollBarPrivate methods that can be re-used for touch events. Change-Id: Id0b0f225a4f86a9d9cc8b77c9253001dd6c40bf4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Prepare for a change to itemGeometryChangedErik Verbruggen2016-11-091-0/+8
| | | | | | | | | In an upcoming patch for qtdeclarative, the rectangle passed to itemGeometryChanged will be the old geometry instead of the difference between the old an the new geometry. Change-Id: If096d4986900fea6ada10b18088de12490c9171b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-11-031-2/+49
|\ | | | | | | | | | | | | Conflicts: tests/auto/accessibility/tst_accessibility.cpp Change-Id: I8c3ccb301730ecdc0acdcb75de607cdd4f753e15
| * ScrollBar: Fix documentation review findingsMitch Curtis2016-11-031-2/+49
| | | | | | | | | | | | Change-Id: I83703bf0188aa52b873f717b3470ceba4a4d670e Task-number: QTBUG-55904 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-11-021-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-10-311-3/+30
|\| | | | | | | | | | | | | | | | | | | | | 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
| * Scrollers: give control over layouting if parent != flickableJ-P Nurmi2016-10-281-3/+30
| | | | | | | | | | | | | | | | | | This allows utilizing the convenient attached properties of ScrollBar and ScrollIndicator, but positioning the scrollers outside of a clipping Flickable. Change-Id: I46fe79110658f4797469d042c56f51548eef6c70 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-10-191-2/+4
|\| | | | | | | | | | | | | | | Conflicts: src/imports/controls/doc/snippets/qtquickcontrols2-swipedelegate.qml src/imports/controls/material/qquickmaterialstyle.cpp Change-Id: I00b533e28407f87a31588e92109a468a5bfb4cc8
| * ScrollBar::increase/decrease(): remember the previous active statusJ-P Nurmi2016-10-171-2/+4
| | | | | | | | | | | | | | | | | | These methods toggle the active status to flash the scrollbar. The active status must not be inactivated if the scrollbar was already active while increasing or decreasing eg. via buttons. Change-Id: I2902f58a26ab5e56ff89aa921cae7a7ae8404ee3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | ScrollBar: keep active while hoveredJ-P Nurmi2016-10-171-4/+16
| | | | | | | | | | | | | | Improves usability on desktop, when hover is enabled. Change-Id: Ib67db80e278a9369da73d81946a9001d432376aa Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-10-071-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * ScrollBar: replace PNGs with GIFsMitch Curtis2016-10-061-2/+2
| | | | | | | | | | | | Change-Id: I0c0f23b88c0ce36d43bc31321371508ec63c2903 Task-number: QTBUG-55904 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Fix missing scroll bars and indicatorsJ-P Nurmi2016-07-141-2/+2
| | | | | | | | | | | | | | | | The layouting code broke in commit aa823b2 that fixed the build after item change listener changes in qtdeclarative. Change-Id: Ife3c598c6aca03f0aebe1fdf32f5ca412de62f0d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>