aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquicktumbler_p_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-07-171-0/+1
|\ | | | | | | | | | | | | | | | | Conflicts: src/quickcontrols2/qquickstyle.cpp src/quicktemplates2/qquickscrollview.cpp tests/auto/qquickstyle/tst_qquickstyle.cpp Change-Id: I9afddf07a956f43cf0445e91b8d1a02f167b6bd5
| * Move all pendingCurrentIndex assignments to a private setterMitch Curtis2018-07-031-0/+1
| | | | | | | | | | | | | | | | | | This makes debugging significantly easier, in that it's now possible to use one qDebug() statement for the assignment rather than a handful at different places in the code. Change-Id: Ic6fdc2943b6eeb0496148b07d7a3ece0b6399c1b Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-06-251-3/+10
|\| | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/imagine/TextArea.qml src/imports/controls/imagine/TextField.qml tests/auto/controls/data/tst_tumbler.qml Change-Id: I25a8228a4299fb7a53db70b7223663a1637ed933
| * Fix Tumbler not respecting currentIndex changes in onModelChangedMitch Curtis2018-06-131-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The use case in the referenced bug report looks something like this: Tumbler { model: 4 // ... onModelChanged: { currentIndex = model - 2; } } The problem was that setting currentIndex in onModelChanged would cause the wrap to change to true, which in turn caused the internal view to change to PathView. This would cause the currentIndex to be set to 0 on successive model changes (i.e ++model). By keeping track of whether or not the user set the currentIndex during a model change, we can ignore changes in the internal view's currentIndex and restore the user's currentIndex afterwards. Task-number: QTBUG-68737 Change-Id: I25738f36cf58a331d1b8e50b5029b4aa1dd27db5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-05-071-20/+15
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-20/+15
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Inherit QQuickControlPrivate from QQuickItemChangeListenerJ-P Nurmi2018-04-121-2/+1
| | | | | | | | | | | | | | | | | | | | This is a preparation step to allow QQuickControl to listen to implicit size changes in the background and content item, so that we can eventually add support for insets. Task-number: QTBUG-60156 Change-Id: Ifa2ca9d2a19c8237cd050d883552542ed119f344 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Tumbler: add positionViewAtIndex() functionMitch Curtis2018-02-161-0/+1
|/ | | | | | | | | | | | | | | This calls the respective PathView/ListView function (depending on the value of wrap), and allows users to change the current index without animations. [ChangeLog][Controls][Tumbler] Added positionViewAtIndex() function that calls the respective PathView/ListView function, depending on the value of wrap. This allows changing currentIndex without animations. Task-number: QTBUG-66358 Change-Id: I7fe73bd3e53548ef41a165b68637d99f3171e02e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10J-P Nurmi2018-01-181-0/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/imports/controls/Tumbler.qml src/quicktemplates2/qquicktumbler.cpp src/quicktemplates2/qquicktumbler_p.h src/quicktemplates2/qquicktumbler_p_p.h Change-Id: I8d50991183fe3c5b50a49e00f01bcd3049f5346c
| * Tumbler: reduce amount of signal-slot connections and change listenersMitch Curtis2018-01-171-6/+1
| | | | | | | | | | | | | | | | | | Instead of adding change listeners and signal-slot connections for each attached object, add them once in QQuickTumbler and then notify each attached object all in one go. Change-Id: I6c5e76182c026b24922dcddaeb08ae4b1d4c4c38 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
| * Make Tumbler compatible with deferred executionMitch Curtis2018-01-171-0/+29
| | | | | | | | | | | | | | | | | | Now that the contentItem is created at a different stage, we have to shuffle some code around and add some null checks. Task-number: QTBUG-50992 Change-Id: I34d3a9ea9cb9ab54008a1015b37b1666538c085e Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* | Optimize QQuickTumblerJ-P Nurmi2017-11-021-2/+35
|/ | | | | | | | | | | | | | Listen to the relevant view changes once in QQuickTumbler and cache the offset/contentY instead of every QQuickTumblerAttached instance doing its own geometry and child tracking, and cache the view offset or contentY so that they are readily available while calculating displacements for attached property objects. This gives a 5% boost (40->42 frames in qmlbench) on TX1 in release mode. Change-Id: If1a77468e812e65bc07f32216ff9bf2e1dc5b935 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Tumbler: fix regression with currentIndex and currentItemMitch Curtis2017-07-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 2c4b2d48 made Tumbler's wrap property follow its count by default, but did so using updatePolish() to account for the use case where a items are appended to the model in a for loop, as is done in TumblerDatePicker.qml in Tumbler's auto tests. This (appending items one at a time in a for loop) is not a good idea, but it should work. The problem with the solution is that the delay means that the use cases mentioned in the referenced bug report were broken. This patch removes the delay. The recursion guards are necessary due to the complex nature of TumblerView (and its non-standard use of the Qt Quick views), as they prevent a memory leak in QQuickListView::createHighlight() from being introuduced. We now call deleteLater() to ensure we do not interfere with the views' internal operations, and hence we also perform a few extra operations at the same time as insurance (although it appears that simply unparenting the internal view from QQuickTumblerView is enough to get the tests to pass). Task-number: QTBUG-61374 Change-Id: Ifef9e99522ea183b282ac862f346beaed12d0c09 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Welcome to 2017J-P Nurmi2017-01-091-1/+1
| | | | | Change-Id: If68cff4efacc7dc5719c8b8e61937e85e9076870 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Tumbler: make wrap property depend on count by defaultMitch Curtis2016-07-011-0/+113
[ChangeLog][Important Behavior Changes][Tumbler] Changed the default value of wrap to be false when count is less than visibleItemCount. Explicitly setting wrap overrides this behavior. Change-Id: I0089f517a25a606625c245df52b0db5fd859ffc0 Task-number: QTBUG-53587 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>