aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickpathview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Run includemocs in qtdeclarativeThiago Macieira2017-04-261-0/+1
| | | | | Change-Id: I84e363d735b443cb9beefffd14b8c023a37aa489 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port existing qmlInfo callers to qmlWarningRobin Burchell2017-01-111-1/+1
| | | | | | | | | | | | | Now that qmlInfo actually reports info messages, we want to change existing callers to use warning-level messages to preserve the original message level. This was done through: perl -p -i -e "s/qmlInfo\(/qmlWarning\(/" **/*.{cpp,h,qdoc} .. with a little care taken to only add the hunks that should be changed. Change-Id: I511cee11ce0a26ec1048cd2b84c7536b812a0d89 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* PathView: fix crash on path removeOleg Yadrov2017-01-111-7/+14
| | | | | | | | | | There was no check if new path is a valid object Task-number: QTBUG-53917 Change-Id: I2fd9534c1d34633243d16eda56a2b07e18dabe16 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* PathView: remove qmlMode() functionAnton Kudryavtsev2016-10-121-20/+14
| | | | | | | | This function is just needless wrapper of std::fmod. Use std::fmod directly. Change-Id: I848164ab260478971e43e69d9e5c3ed852f333b4 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Quick: mark some methods as constAnton Kudryavtsev2016-10-121-2/+2
| | | | | | | These methods do not modify objects. Change-Id: Ibb2622cad6fbcec31c785f5d032304c648372350 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* PathView: use nullptr instead of 0Anton Kudryavtsev2016-09-141-24/+24
| | | | | Change-Id: I5f40c18a619fe22ea6c2d0e709ff163e80d6e74d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-191-2/+2
|\ | | | | | | Change-Id: I326616356ee26d4532c6d57558c43c919f0a900d
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-181-2/+2
| |\ | | | | | | | | | Change-Id: I20c622263f40c322954328e4d10a8071db3ca6d1
| | * QQuickPathView: fix doc for itemAt() and indexAt()Anton Kudryavtsev2016-08-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | These methods have real arguments. Change-Id: I61f42076d36265b58dcc598394c6b3576b02dd60 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* | | Quick: replace 'foreach' with 'range for'Anton Kudryavtsev2016-08-181-5/+8
| | | | | | | | | | | | | | | Change-Id: I3493b16a184fc811289db9e98eff37bb987113a3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | QQuickPathView: optimize releasing of cache itemsAnton Kudryavtsev2016-08-181-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | Release all cache items, and then clean container. Avoid quadratic complexity. Change-Id: I61f3e43aa070c0be074c3804a83f2ff1de9a398d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | QQuickPathView: de-duplicate calls and cache resultsAnton Kudryavtsev2016-08-181-4/+6
| | | | | | | | | | | | | | | Change-Id: I4b49b912c068fd5c76a2c2c8580f616cb42e9bdb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | QQuickPathView: de-duplicate code of indexAt()Anton Kudryavtsev2016-08-171-10/+2
| | | | | | | | | | | | | | | | | | | | | Re-use itemAt() method. Change-Id: Ic3673fe4d9fd3f27abc90c9436e99e0da9821cdb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | QQuickPathView: port some loops to 'range for'Anton Kudryavtsev2016-08-171-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | The 'range for' works with pointer increments and the generated code is less, so we save some text size. Change-Id: I66a2827c9a342d9453a52028d3ec76a91a19a606 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-171-21/+39
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmltypecompiler.cpp src/qml/compiler/qv4isel_moth.cpp src/qml/compiler/qv4ssa_p.h src/qml/qml/qqmlobjectcreator.cpp Change-Id: I8bb7fe773d657f908f20ee5e72c2b9bd643f6260
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-131-21/+39
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4isel_moth.cpp src/qml/compiler/qv4ssa_p.h tests/benchmarks/qml/qqmlimage/qqmlimage.pro tests/benchmarks/qml/qqmlimage/tst_qqmlimage.cpp Change-Id: Iad11ce7fdf0c6d200fdebc16a94081bd8069a87a
| | * PathView: fix infinite construction/destruction loopAnton Kudryavtsev2016-08-121-18/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... when all (or almost all) items are in the cache. When all items are in cache, check lower bound is equal to upper_bound. In rare cases, especially when almost all items are in cache, the inserting code was used (not only appending and prepending). In this code there was not bound check before creation of item and there was such situation: 1. Create item by inserting code (without bound check) 2. At the next call of refill() remove this item by life cycle because this item does not meet the conditions. And go to step 1. In other words at the first call we create some item, at the second remove this item. And again. So we had infinite construction/destruction loop. To break it we should check position of new item before creation in inserting code too (like we do in appending and prepending code). Task-number: QTBUG-37815 Change-Id: I015cdeb67ca5fcd06c34b3145b49cbd3e38d4078 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| | * PathView: fix item creationAnton Kudryavtsev2016-08-121-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First call of QQuickPathView::refill() did not use currentIndex for item prepending and there was situation when items were not created, e.g.: PathView with current item in center and currentIndex was set so that item with index 0 was after current item and before path end. The result of this situation: items from path begin to current item were not created. The reason was that idx always equaled (modelCount-1) for item prepending. Now first filling uses currentIndex to calculate valid idx. Task-number: QTBUG-53464 Change-Id: I7e343b0712c9c5c5cd56b1d8e020cf8c0f6e6301 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Quick: use const (and const APIs) moreAnton Kudryavtsev2016-08-121-6/+6
|/ / | | | | | | | | | | | | | | For CoW types, prefer const methods to avoid needless detach()ing. Change-Id: I270cdc6eb8c5946f5c20b379bbb7c60f0ba518eb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-201-4/+6
|\| | | | | | | | | | | | | | | Conflicts: src/qml/jit/qv4targetplatform_p.h src/quick/accessible/qaccessiblequickitem_p.h Change-Id: Ic95075a5fad81ec997a61561bd65979dfa3b9d4d
| * ItemViews: Make the wording of the warning on cache properties slightly sterner.Robin Burchell2016-06-161-4/+6
| | | | | | | | | | | | | | | | | | I have seen far too many cases of someone simply setting cacheBuffer to a massive number in an attempt to workaround a slow delegate. It should be explicit that cacheBuffer is not a solution for these problems. Change-Id: I09416d06ff7faf51a104e09ca5f6b3593ddc53c7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-101-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of 0e053528 was reverted in the merge, about lastTimestamp. It will be applied later in separate commit. qmltest::shadersource-dynamic-sourceobject::test_endresult() was blacklisted on linux. Conflicts: .qmake.conf tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp tests/auto/qmltest/BLACKLIST tests/auto/qmltest/qmltest.pro Task-number: QTBUG-53590 Task-number: QTBUG-53971 Change-Id: I48af90b49a3c7b29de16f4178a04807f8bc05130
| * Fix grammar in PathView docsMitch Curtis2016-05-271-1/+1
| | | | | | | | | | | | | | | | Change-Id: Ibce14fddcbb608ffddb69f01e168d10c924c2957 Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* | Quick: expose movementDirection of PathViewLiang Qi2016-05-021-6/+49
| | | | | | | | | | | | | | | | | | It is needed by the behavior of TabBar in universal style in QtQC2. [ChangeLog][QtQuick][PathView] Added movementDirection property Change-Id: Iedc214a12e7336e52125ec82b9ded45502905978 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | Use QStringRef to optimize memory allocationAnton Kudryavtsev2016-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace substring functions that return QString with corresponding functions that return QStringRef where it's possible. Create QString from QStringRef only where necessary. While touching the code, also port loops to C++11 style. Change-Id: I04c99b24ea6afd3715e3edf9ea00bfab838fd53c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-291-0/+4
|\| | | | | | | Change-Id: Iec1b2de53c275996364c4bab0123ccb3e6e9895e
| * PathView: don't leak item referencesJ-P Nurmi2016-01-281-0/+4
| | | | | | | | | | | | | | | | | | | | Every getItem() call increases the reference count. If getItem() was called on an item that was already managed, we must pair it with a call to releaseItem() in order to keep the reference count in sync. Change-Id: I897d19c77bc0c58717065cbe925c45a14153ad0b Task-number: QTBUG-50655 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-191-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Fix QQuickPathViewPrivate::snapToIndex()J-P Nurmi2015-10-221-5/+5
| | | | | | | | | | QQuickPathView::setCurrentIndex() set moveReason to "SetIndex", but snapToIndex() overrode it to "Other". This caused updateCurrent() to change the current index during snap animation and caused binding loops in Qt Quick Controls 2. Change-Id: I6c5f34c69886cb5c234ed78535bb356fbb38b3a6 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Remove ordered list assumptions in PathViewAlan Alpert2015-05-181-47/+112
| | | | | | | | | | | | | | | | | | When flicking fast or jumping around on paths with some items not seen, the current algorithm makes assumptions about list ordering which are hard to maintain. Specifically that it has the index of the first item in the list cached and that all changed will be to either prepend or append an item to the current ordered set. This patch removes that assumption, leading to a little more work each time to identify where new elements will go. There is still a slightly faster path for the common case of adding elements to the beginning or end of the path. Task-number: QTBUG-42716 Change-Id: Ief76c93967d254d405e6656ef27d06b4ecc470c8 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* PathView: use qt.quick.itemview.lifecycle logging categoryShawn Rutledge2015-03-131-3/+17
| | | | | | | | It is the same for debugging delegate cycling in ListView. Task-number: QTBUG-42716 Change-Id: I54b83a25a5d8473c643cd326fe114317103bb24e Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Fix invocations of static methods of QGuiApplication/QCoreApplication.Friedemann Kleint2015-03-051-2/+3
| | | | | Change-Id: I7bcc209b0c6e77cf6d974af85a19487345a48975 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* Cleanup math function includes and usageAllan Sandfeld Jensen2015-02-191-7/+3
| | | | | | | | Use std::math on floats and doubles, and qMath on qreals, and only include the math headers actually needed. Change-Id: I1d511d7b1bac0050eaa947c7baee760b736858bf Reviewed-by: Sean Harmer <sean.harmer@kdab.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>
* Check for "c" being a nullptr in all placesHolger Hans Peter Freyther2015-01-141-1/+1
| | | | | | | | | So either c is never a nullptr or there is a potential crash in the grab code. Replicate the check from above. Change-Id: I2c93502c026cdd92dc5d20e3d6d59e6f6f92a6ce Fixes: Coverity CID 10628 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Repeater & itemviews: fix setModel() JS array handlingJ-P Nurmi2014-10-291-1/+5
| | | | | | | | | | | | 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>
* PathView: Fix QML engine thinking currentItem is null when it's notSérgio Martins2014-10-101-0/+5
| | | | | | | | QML didn't re-evaluate any bindings using currentItem because a notification was missing. Change-Id: Icdaa3022e0b01644a060e577d87f011b4ea9fabb Reviewed-by: Alan Alpert <aalpert@blackberry.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>
* Merge remote-tracking branch 'origin/5.3' into 5.4Simon Hausmann2014-08-121-5/+12
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4include.cpp src/quick/items/qquickrendercontrol.cpp src/quick/items/qquickrendercontrol_p.h src/quickwidgets/qquickwidget.cpp Change-Id: Ib2dc0051a38cd283a37a7665eb4a76f6f7ec8b15
| * Synchronize PathView gesture grabbing with other items.Martin Jones2014-08-061-5/+12
| | | | | | | | | | | | | | | | | | | | | | PathView didn't attempt to grab the gesture at the same event as other items. This prevented PathView from rightfully claiming the gesture before lower items in the stack. Use the same threshold test for PathView as used elsewhere. Task-number: QTBUG-37859 Change-Id: Ic57cb805ac979e41c3e35d86b2e7db781e61d69d Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* | Merge remote-tracking branch 'origin/5.3' into devSimon Hausmann2014-07-261-0/+10
|\| | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/jsruntime/qv4arrayobject.cpp src/qml/jsruntime/qv4engine.cpp Change-Id: Ie3ef6202b6a3a8521971e1be10c40c6a2db6989c
| * Schedule layout changes to avoid refill() recursion.Mitch Curtis2014-07-241-0/+10
| | | | | | | | | | | | | | | | Otherwise we add duplicate item delegates. Task-number: QTBUG-40298 Change-Id: I8a2221d72f458c892720a71d87513808a5d725a6 Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* | Fix QQmlDelegateModelChangeArrayLars Knoll2014-07-221-2/+2
|/ | | | | | | | | | | | The class had a vtable, clashing with assumptions about Managed objects. The derived classes where actually only cosmetic sugar on top of the basic change class. Clean this up and unify the functionality in the base class. In addition adjust the class to the new data layout. Change-Id: I8677f6c71465381f7ebdf82eb6025fda6d137ec3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* QQuickItemView/QQuickPathView: Fix creation of delegatesAlbert Astals Cid2014-04-181-0/+2
| | | | | | | | | | When the delegate is set before the model and after the ItemView/PathView has been created Task-number: QTBUG-38368 Change-Id: I6963abe28087699cf4e8921153dc7641bae3b220 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Doc: Document signals (not handlers) under \qmlsignalSze Howe Koh2014-03-181-15/+27
| | | | | | | | Append the handler names to the end of the corresponding signal doc. Task-number: QTBUG-35846 Change-Id: I3d627ba7ed5be94e5c402ab092b4d582536499e8 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Flickable: Use increased default flick parameters on BB10Oleg Shparber2013-12-111-16/+1
| | | | | | | | | | | | | | | Due to the high resolution the display default flicking speed is rather slow. This change introduces increased values of QML_FLICK_DEFAULTMAXVELOCITY and QML_FLICK_DEFAULTDECELERATION which feel closer to the native experience. Also cleans up the flick variables a little by moving them to their own header, so that QQuickPathView can also benefit from the improved behavior on BB10. Change-Id: I80878d4cc2a53a8f530b1dc8674f729f70a83119 Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* moveOffset in QQuickPathView::modelUpdated uninitializedMarco Bubke2013-11-091-1/+1
| | | | | | | Get a error for compiling with gcc 2.8.1. Change-Id: If93ed69695fb523eff05cae2960e3743dc496310 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Doc: Fix broken linksSze Howe Koh2013-11-051-1/+1
| | | | | | Change-Id: Ie7408409ddbaa354370267f2dd74326ec56a4186 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Remove ancient and unused leftoversGunnar Sletta2013-10-221-5/+3
| | | | | Change-Id: Ia3a2aa2244748c2f3f2df8853f5bddfbbc4bc19f Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* qdoc: no longer recognizes the version nr in QML refsMartin Smith2013-10-021-37/+37
| | | | | | | | | | All QML references of the form <QML-module-name><QML-module-version>::<QML-type>::<member-name> have had the <QML-module-version> removed i. Task-number: QTBUG-33776 Change-Id: Idde279e0f254cd24ea44f9841662dd81a2c5bbc6 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>