aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickrepeater
Commit message (Collapse)AuthorAgeFilesLines
* Replace obsolete VisualDataModel, *Group and VisualItemModel in testsShawn Rutledge2018-10-052-9/+11
| | | | | | | | | | | | | VisualDataModel, VisualDataGroup, and VisualItemModel are replaced with DelegateModel, DelegateModelGroup, and ObjectModel respectively (since 7cad0e52c5a020bd29635e9912fd8946a6b48124). git grep -l 'VisualDataModel' | xargs sed -i 's/VisualDataModel/DelegateModel/g' git grep -l 'VisualDataGroup' | xargs sed -i 's/VisualDataGroup/DelegateModelGroup/g' git grep -l 'VisualItemModel' | xargs sed -i 's/VisualItemModel/ObjectModel/g' Change-Id: Ie91b37b204f08a5d1f1f38594fb22ed70a6e2080 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Limit the repeater model size for integer modelsErik Verbruggen2018-09-241-0/+6
| | | | | | | | | Otherwise you might be able to put INT_MAX in, which would cause problems with things like memory allocations. Task-number: QTBUG-54752 Change-Id: I758d04af65049181c0c741ff42e92a6450963201 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Fix JS ownership of model and delegate properties in QtQuick item viewsSimon Hausmann2018-05-112-0/+68
| | | | | | | | | | | | | | | | When assigning a JS owned model or delegate to an item view, we must ensure that they stay alive as long as the item view. This happens easily for example when doing something like delegate: Qt.createComponent(...) This patch takes the minimally invasive approach by changing the QObject parent of such objects. Task-number: QTBUG-50319 Task-number: QTBUG-51620 Change-Id: Ie6384b8dd93dcdc62d49f64b38173b3fc4ffd3b3 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix crash when using repeaters with packagesErik Verbruggen2018-05-092-0/+59
| | | | | | | | | | | | | | | | | | | | | When receiving the modelUpdated signal from the delegate model, the repeater - unlike other views - queries for the objects right away. That may result in instant incubation and when using Packages, we will end up delivering the initItem signal emission for the parts models via QQmlDelegateModelGroupPrivate::initPackage for _both_ repeaters immediately. For the first repeater that's expected, but for the second repeater that means initItem is received before modelUpdated was called. That is very confusing for the repeater as d->deletables is not set up yet. While it's possible to make the repeater more "robust" towards such behaving models, it seems cleaner to make the model behave well, by ensuring that we emit initItem after modelUpdated. Task-number: QTBUG-50349 Change-Id: Id2f3ba135e34d0111c8896bb4ecdfe51c8c649da Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-24/+24
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix crash when moving items during asynchronous creationJoni Poikelin2017-11-282-0/+76
| | | | | | | | | | | | | | | In complicated cases where the model moves rows around while the view is running slow (perhaps during high CPU load), there were cases when Repeater would call movedItem->stackBefore(deleteableItem), but deleteable items can be null, so there was often an error QQuickItem::stackBefore: Cannot stack before 0x0, which must be a sibling and occasionally a crash. Now we check both the callee and the parameter to stackBefore to make sure neither of them are null. Task-number: QTBUG-54859 Change-Id: I45a8b2939c16b9bbe3a802ddd348dc55f51061a7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Updated license headersJani Heikkinen2016-01-201-17/+12
| | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Remove CONFIG += parallel_test.Friedemann Kleint2015-09-051-1/+0
| | | | | | | The keyword no longer has a meaning for the new CI. Change-Id: I699f2881e291cce02a6a608a8710638886e38daa Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Tests: Remove QT_DISABLE_DEPRECATED_BEFORE=0 for simple cases.Friedemann Kleint2015-09-021-1/+0
| | | | | | | Fix usage of API that is marked deprecated. Change-Id: Ia887437f99b9ce207891ca19bc49294acb7d629d Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
* tests/quick: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-07-271-9/+9
| | | | | | | | | | | | - Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Change-Id: Ib9f4c2486af23c47990be4b9e004b965de226dcc Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Tests: Replace Q[TRY]_VERIFY(v == true|false) by QVERIFY(v)|QVERIFY(!v).Friedemann Kleint2015-07-271-2/+2
| | | | | | | | Preparing the replacement of Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) for non-boolean types. Change-Id: I8a4e44a2b4e20a9c8b811799e3932c8ce1a2cbbb Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Prevent errors when removing items from Repeater that reference parent.Michael Brasser2015-06-302-0/+38
| | | | | | | | | Use the same ordering as item views and release before unparenting. Change-Id: I0346342cfcaf9385d8385769795dd5ba35fc43aa Task-number: QTBUG-46828 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* ObjectModel: add API for dynamic changesJ-P Nurmi2015-06-102-0/+88
| | | | | | | | | | | | | | | | Following the ListModel API: - object get(index) - append(object) - insert(int index, object) - move(int from, int to, int n) - remove(int index, int n) [ChangeLog][QtQml][ObjectModel] Added get(), append(), insert(), move() and remove() methods. Change-Id: I592e55b7c4c933a1100191bf5a9405944b347172 Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Make Repeater emit items with right stacking orderJan Arve Saether2015-04-282-0/+57
| | | | | | | | | | | When listening for Component.onCompleted on the items emitted by the Repeater, the items' stacking order was not properly set up. The stacking order was corrected after Component.onCompleted was emitted, which was undesirable in some cases. Task-number: QTBUG-45423 Change-Id: Ib96b3de81db556b09fb5fc8bd27ce19223014f7e Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Repeater: Don't rely on the createFrom variableJørgen Lind2015-03-172-1/+72
| | | | | | | | | | | | since this breaks for asynchronous models, because item creation order is not guaranteed. We always have the index for what item to create, so we do not need it either. Change-Id: Ib8ce25ac342f5cce4784c56e6a91cf70136566b3 Task-number: QTBUG-38879 Task-number: QTBUG-39001 Task-number: QTBUG-44250 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* QQuickRepeater::clear: Remove items from the end backwards.Robin Burchell2014-11-072-0/+69
| | | | | | | | | | | This way, the indices for itemRemoved will make sense consistently. This was broken with 5f5aba5b6e690ca54e66f41b93474f7e67e83c8b, dated November 2011. Task-number: QTBUG-42243 Change-Id: I5fecfd4174049f51e0cec90e40e6332de5d5bf01 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Repeater & itemviews: fix setModel() JS array handlingJ-P Nurmi2014-10-291-0/+28
| | | | | | | | | | | | QVariant comparison in setModel() started failing because JS arrays are now passed as a QJSValue. Re-assigning the same array content should not trigger a model change. This change restores the old behavior it had before, when JS arrays were passed as QVariantLists. Change-Id: I1882b3531f2893b116dbd817edeecab1ae812ce8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Fix crash in QQmlDelegateModel during destruction phaseSimon Hausmann2014-06-242-0/+50
| | | | | | | | | | | | | It has been reported multiple times (with different back traces) that the QQmlDelegateModel tries to access a dangling QQmlContext pointer. The scenarios for reaching this point differ slightly, one such scenario is very late model activity during the scene destruction. The provided test-case simulates that and the provided patch guards the QQmlContext in a QPointer. Task-number: QTBUG-39780 Change-Id: I594ee4918cd1b78c5db5c164314e85e9eea99fbd Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* fix whitespaceOswald Buddenhagen2014-01-221-5/+5
| | | | | | | remove trailing spaces and expand tabs Change-Id: Ieacb9d096b612c45d1a64700044c114d1f7522bc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix crash in repeater when model gets deletedFrederik Gladhorn2013-04-182-0/+35
| | | | | | | Task-number: QTBUG-200461 Change-Id: Ia8e48668960ac005cf773bf6f53da40f1c753b9b Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-011-0/+1
| | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I6988c2360e9d88916311374a0c910bfc5b607439 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove QListModelInterface.Andrew den Exter2012-07-251-1/+0
| | | | | | | | | | Implement ListModel and XmlListModel using QAbstractListModel instead. Task-number: QTBUG-15728 Change-Id: I14e03d90883d341f4b1d89c1e9fc9dc1534fde78 Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
* Don't double reference items created following a model reset.Andrew den Exter2012-07-171-0/+79
| | | | | | | | | If the model was reset then regenerate and exit immediately rather than processing the change set. Task-number: QTBUG-26536 Change-Id: I9d4f20d450a5116957c9468ba6088caad026a497 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* QQuickCanvas renamesAlan Alpert2012-07-171-58/+58
| | | | | | | | | | | | | | | | QQuickCanvas is now called QQuickWindow QQuickCanvas::rootItem is now QQuickWindow::contentItem QQuickItem::canvas is now QQuickItem::window QQuickItem::ItemChangeData::canvas is also renamed window QQuickCanvas::grabFrameBuffer is now QQuickWindow::grabWindow The functions related to the color property have dropped the clear from their names. The first three changes have interim compatibility measures in place to ease the transition. Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d2 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Change repeater item to handle model being deleted.Glenn Watson2012-03-132-0/+35
| | | | | | | | | | | | The repeater item previously stored a raw QObject pointer in a variant. When this pointer was a dynamic list model element that was deleted, the variant would continue to hold a stale pointer. Change repeater to use a guard object to hold the model when it is a QObject. Continue to use a variant to hold models that are not based on QObject to maintain same semantics. Change-Id: Ie100947132923803263c725e86efa68206382f12 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Changed quick tests to work from install directoryKurt Korbatits2012-03-071-3/+1
| | | | | | | | | - Changed tests to use TESTDATA - added check for cross_compile option to skip when sources not available Change-Id: I1f382794ff982bbc07fc20438a4e4a8c8b8d565f Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-2411-0/+924
Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>