aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickscrollindicator.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Templates: use C++11 default member initializationJ-P Nurmi2018-05-041-26/+10
| | | | | | | | | | | 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>
* ScrollIndicator: allow configuring the minimum sizeJ-P Nurmi2017-11-081-7/+104
| | | | | | | | | | | | | | | | Same as 9e1b044 for ScrollBar. 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][ScrollIndicator] Added minimumSize, visualSize, and visualPosition properties. Task-number: QTBUG-56557 Change-Id: I7deda3bea7a5a020bda79af433bfa38f326952d8 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Merge remote-tracking branch 'origin/5.9' into devJ-P Nurmi2017-07-111-0/+7
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf tests/auto/controls/data/tst_scrollindicator.qml Change-Id: I1f5581ae7814c0d4152e4c9b79a30a8af5a3a17b
| * ScrollIndicator: don't block touchJ-P Nurmi2017-07-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | Unlike with mouse events there's setAcceptedMouseButtons(), currently there's no way to control whether a control receives touch events or not. As a temporary workaround until QQuickItem::setAcceptTouchEvents() has been added, we'll have to ignore touch events by hand. Task-number: QTBUG-61785 Change-Id: I9a678570bfdd104ae32b4040ecef7625dcfd1aee Reviewed-by: Mitch Curtis <mitch.curtis@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>
* | ScrollIndicator: add horizontal and vertical properties for convenienceJ-P Nurmi2017-03-281-0/+32
|/ | | | | | | | | [ChangeLog][Controls][ScrollIndicator] Added horizontal and vertical properties to make it more convenient to create orientation-dependent bindings in styles. Change-Id: I8670456bb84387af99440ba25ab652c07ec1cb29 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>
* QQuickScrollBarAttached: fix change listener removalJ-P Nurmi2017-01-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* QQuickScrollIndicator: fix layouting on implicit size changesJ-P Nurmi2017-01-201-6/+24
| | | | | Change-Id: I440dbc1ef97486b6c9129802c2eda7f5d4ca0ebd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* ScrollIndicator: 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: I2e229ff59363246fc4515b1c7cbf1850dd2b1d43 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-3/+11
| | | | | | | | 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>
* Welcome to 2017J-P Nurmi2017-01-091-1/+1
| | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 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-3/+40
|\ | | | | | | | | | | | | Conflicts: tests/auto/accessibility/tst_accessibility.cpp Change-Id: I8c3ccb301730ecdc0acdcb75de607cdd4f753e15
| * ScrollIndicator: fix documentation review findingsMitch Curtis2016-11-031-3/+40
| | | | | | | | | | | | Change-Id: Ia742b82e9aaacb35cdde5087ccb1deb977af51ed 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.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
| * ScrollIndicator: replace PNGs with GIFsMitch Curtis2016-10-061-2/+2
| | | | | | | | | | | | Change-Id: I04d55b0e2e089cb55c26b921409ff2e5e58f55d9 Task-number: QTBUG-55904 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Merge remote-tracking branch 'origin/5.7' into 5.8J-P Nurmi2016-09-021-4/+9
|\| | | | | | | Change-Id: I82da1e547c4ead1181ade19f77c62651c00998a3
| * ScrollIndicator: respect the paddings when overshootingJ-P Nurmi2016-08-301-4/+9
| | | | | | | | | | | | Task-number: QTBUG-55620 Change-Id: I4c06a9e7fefbdbaff7f14a972ed47242c51ca8c6 Reviewed-by: Mitch Curtis <mitch.curtis@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>
* | Fix build after QQuickItemChangeListener changesJ-P Nurmi2016-07-131-6/+6
|/ | | | | | | | qtdeclarative commit e2c296c changed the itemGeometryChanged() signature. Change-Id: Ibe163e1d6fe8535a4ec01de047d72a0d4863979d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQuickScrollBar & Indicator: cleanup item change listenersJ-P Nurmi2016-06-141-6/+16
| | | | | | | | | | It's a bit uncertain how it managed to slip through the CI, but tst_controls is currently crashing consistently on Windows (MSVC 2015) during the cleanup of ScrollBar::test_mirrored(). This patch fixes the crash, which happens due to dangling listener pointers. Change-Id: I0a3640786f01f98e9a2bcb600913a7d5fbfe4823 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>
* Doc: cleanup remaining "labs" referencesJ-P Nurmi2016-04-211-2/+0
| | | | | Change-Id: I5b0015476c3ceef8f82b00d99b084b1ce3bfaa6f Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Doc: rename Qt.labs.controls 1.0 to QtQuick.Controls 2.0J-P Nurmi2016-04-211-7/+7
| | | | | | Change-Id: Id6c476424fa359d222f027584278346fc0984069 Task-number: QTBUG-52549 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* ScrollBar|Indicator: use QQmlInfo and don't crash with non-FlickablesJ-P Nurmi2016-04-151-14/+18
| | | | | | | | | | | | | | Before: ScrollBar must be attached to a Flickable QQuickItem(0x1774640) The program has unexpectedly finished. After: qrc:/main.qml:9:5: QML : ScrollBar must be attached to a Flickable Change-Id: I689d70744f64e209eacb4cb743ad64e904f29cd4 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Templates: update license headersJ-P Nurmi2016-04-141-2/+2
| | | | | | | This file is part of the Qt Quick Templates 2 module of the Qt Toolkit. Change-Id: I39ef9cbb00f55a32b7a43f11ffbdfbb40b84e124 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Doc: add 2-suffix to the image assets and snippetsJ-P Nurmi2016-04-131-2/+2
| | | | | Change-Id: Ib8050cb3baefe07d28c7e2dcec64af155d2d7c9b Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Templates: rename the C++ module to qtquicktemplates2J-P Nurmi2016-04-131-0/+429
Change-Id: I146da903b46f5c2caf865e37291c25376b49021a Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>