aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitemview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QQuickItemView: Take sticky header/footer into account for ↵Robin Burchell2016-01-151-2/+2
| | | | | | | | | | | positionViewAtIndex(). When using an overlaid header or footer, we must adjust the position we come up with by the appropriate size in order to end up at the correct place. Change-Id: I218b9aef7fdf37f56ffb63dc395f97045b55a186 Task-number: QTBUG-50097 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Item views: Don't emit 'currentItemChanged' if the current item didn't ↵Gabriel de Dietrich2015-09-051-1/+2
| | | | | | | really change Change-Id: I8892bb9b6ab6737d4a6f6f8aab836f863668682e Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Fix potential use of incorrect bounds in delegate tracking.Michael Brasser2015-07-121-14/+31
| | | | | | | | | | Using GridView.SnapToRow and GridView.ApplyRange with a top margin could lead to the view jumping (rather than smoothly transitioning) when changing the currentIndex. Change-Id: I6936b378220f59e8d416f7531cf8b6906c723cb2 Task-number: QTBUG-45640 Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
* Fixed a QQuickListView crashLiang Qi2015-06-291-18/+26
| | | | | | | | | When an ObjectModel item is removed and destroyed. Task-number: QTBUG-46798 Change-Id: Ia41dd359d9f3ec5b7af85498dc798f7ab55dca3c Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* ListView/GridView contentHeight should include delayRemove-d itemsMatt Vogt2015-06-231-2/+3
| | | | | | | | | | When one or more items are in delayRemove state, the ListView's contentHeight property should include their height. This previously failed if the delayRemove items were at the end of the visibleItems list. Also applies to GridView. Change-Id: Id839e850367a3503123e8ac81dac6ebdccef1a1f Reviewed-by: Martin Jones <martin.jones@qinetic.com.au>
* Item views: don't assume that attached objects existJ-P Nurmi2015-06-091-10/+14
| | | | | | | | | | Attached properties are only on objects created by QML. In case a QQmlInstanceModel contains items that were created in C++, the attached properties object doesn't exist. Adding the missing null checks avoids a crash in such scenario. Change-Id: I93148ac6cefa4cb83a8a7eb24a84b125aaa443d2 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Fix build with QT_STRICT_ITERATORSSérgio Martins2015-05-151-1/+1
| | | | | Change-Id: I3df6ac107cb46b3a1b15b80f39d7c6015adcd9ac Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* QtQuick: Micro-optimize iterator loops.Friedemann Kleint2015-02-261-3/+5
| | | | | | | Avoid repeated instantiation of end() in loops, use variable instead. Change-Id: I6ab1fe2b82406d5ee91710a0333587ffb82c04d4 Reviewed-by: Erik Verbruggen <erik.verbruggen@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>
* 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>
* 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>
* ItemView: use categorized logging for delegate lifecycleShawn Rutledge2014-08-131-0/+2
| | | | | | | | | It becomes configurable at runtime instead of having to uncomment and recompile. Change-Id: I2c6f24c89f7e6fe1a9a77b948cdac6f2994680bf Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Merge remote-tracking branch 'origin/5.3' into devSimon Hausmann2014-07-261-6/+8
|\ | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/jsruntime/qv4arrayobject.cpp src/qml/jsruntime/qv4engine.cpp Change-Id: Ie3ef6202b6a3a8521971e1be10c40c6a2db6989c
| * Don't recreate header and footer unnecessarilyMartin Jones2014-07-251-6/+8
| | | | | | | | | | | | | | | | | | | | The only time that they need to be recreated is if the orientation changes (even then, a good implementation could handle it, but no point requiring that now). Task-number: QTBUG-40375 Change-Id: Id0215fb812724827bb139cda8f8dc6208c703852 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* | Fix QQmlDelegateModelChangeArrayLars Knoll2014-07-221-8/+8
|/ | | | | | | | | | | | 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>
* Make ItemViews displayMargin work correctly when set to negative valuesAlbert Astals Cid2014-06-041-2/+2
| | | | | | | | | We need to call forceLayoutPolish instead of refillOrLayout so that the visibility is correctly updated. Also update one line that sets visibility in GridView Change-Id: I29fa67cdd5196a744fab9507b4104cb83ad4bf5e Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* Item views: prevent negative cache bufferJ-P Nurmi2014-05-071-0/+5
| | | | | | | | | | A negative cache buffer does not make much sense, and the item views would go crazy and start creating/destructing delegates endlessly. Task-number: QTBUG-38725 Change-Id: I1fbba1f3130a99af67fbc4c2aba4d3199d0554a9 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* 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>
* ListView: fix rounding errorsJ-P Nurmi2014-04-091-2/+2
| | | | | | | Task-number: QTBUG-37339 Change-Id: I223e4d6bcabb1daa705c0ed2212e7e2b2fc3f37c Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Item views: improve initial Z-value handlingJ-P Nurmi2014-03-181-2/+4
| | | | | | | | | | Respect the initial Z-values of item, highlight, header, footer and section delegate instances. Mention also the default values in docs. Change-Id: I2ce4bb537898a0f5fdfa776b79d5747b1c080a7b Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* Item views: avoid fixing up the position while moving/flickingJ-P Nurmi2014-03-131-4/+8
| | | | | | Task-number: QTBUG-35920 Change-Id: Id6a68400eed69d880dd1c218ec4a1beda8a8fbb9 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Make GridView/ListView attached "view" property available to all delegate typesNils Jeisecke2014-02-261-2/+4
| | | | | | | | | | | | | | | This is useful for accessing the view (e.g. "width", "cellWidth", ... properties) from within section (ListView only), header, footer and highlight delegate components. A typical usecase are components that are used in multiple views and therefore cannot use the views's id for access. The only attached property valid for those non-item delegates is "view". This has been added to the documentation. Change-Id: I33d976da778be23ed531a3b193ceee95ed9800d2 Task-number: QTBUG-32836 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-02-181-1/+1
|\ | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4functionobject.cpp src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h Change-Id: Id164f6c3b45501aa466908659ec4e3b957323753
| * Fix wrong calculation of viewPort for transitionsFlorian Hänel2014-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | Viewport is calculated wrong for horizontal layout in a second instance Task-number: QTBUG-29944 Task-Number: QTBUG-31546 Change-Id: I136ae4484278d14f796613505e3f38c65ec51ebe Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Florian Hänel <florian.haenel@basyskom.com>
* | Merge remote-tracking branch 'origin/stable' into devSimon Hausmann2014-02-111-2/+3
|\| | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qv4ssa.cpp src/qml/jsruntime/qv4arrayobject.cpp src/qml/jsruntime/qv4context.cpp Change-Id: Ied5b23bec4dc14abe51127c507aed668f855c1e1
| * Fix origin for short reversed item viewsJohn Brooks2014-02-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reversed (BottomToTop and RightToLeft) item views would report an impossible positive value for origin when contentHeight < height. The correct value will be effectively equivalent to the position of the footer, and always negative. Match other logic using lastPosition() by negating its value for reversed views. This fixes a bug with content disappearing in a Controls ScrollView on a BottomToTop view. Change-Id: Ieedbb64ce8fc7c0fb36e5256e437ddeb3e757761 Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
| * Fix crash in header when regenerating view.Michael Brasser2014-01-301-0/+1
| | | | | | | | | | | | | | | | | | Unregister for geometry changes before reparenting, as reparenting may trigger those changes. Task-number: QTBUG-36481 Change-Id: Ia94f1f88880b232dd583b7e63e5da73fb338f7c6 Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-241-1/+6
|\| | | | | | | | | | | | | Conflicts: src/quick/items/qquickrectangle.cpp Change-Id: Ia40bc0f2f08b5be68e32eb1e1f118445d20e44fc
| * Fix positioning of item when first cacheBuffer item is removed.Andrew den Exter2013-12-191-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | When items prior to the first visible item are removed from the instantiated items list the first item is moved forward by the size of the item removed so it position remains correct relative to the visible items. But if the removed item is the first instanitated item then it's size shouldn't contribute to the offset as the next instatiated item is already offset by its size. Task-number: QTBUG-33619 Change-Id: I05c33f505e2856afa08cd9cd89d8eae97c20679d Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Add displayMarginBeginning/End to ListView and GridView.Martin Jones2013-12-111-2/+38
|/ | | | | | | | | | | This allows displaying content outside the visible area of the view. [ChangeLog][QtQuick] Add displayMarginBeginning/End to ListView and GridView. Change-Id: Idf9b5a0cd34a781c9603a9ad98ea189754972ba1 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Also update viewport size when header/footer size changesRobin Burchell2013-11-261-0/+2
| | | | | | | Task-number: QTBUG-24292 Change-Id: I8e7f5abe077b6e8d2ce6625dcf43a34a7260934e Done-with: Martin Jones <martin.jones@jollamobile.com> Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* Fix license headers of QtQuick sources.Gunnar Sletta2013-09-301-1/+1
| | | | | Change-Id: I3750c47640bf21c3567c5fa1c4667e3e2552942e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix currentIndex in Qml itemView when assigning an empty modelNils Jeisecke2013-08-161-1/+1
| | | | | | | | | | When assigning an empty model to e.g. a ListView after component initialization has been completed, currentIndex is now correctly set to -1. Change-Id: I540c034944009ccb8894bf84f400658ef9f0371f Task-number: QTBUG-32838 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Item views: do not track the geometry of items being removedJ-P Nurmi2013-07-041-4/+23
| | | | | | Task-number: QTBUG-31873 Change-Id: I4230893ccb2925ed9c2429d26b411264bf7c1c65 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Protect against null item at QQuickItemView::destroyingItemAlbert Astals Cid2013-04-301-2/+4
| | | | | Change-Id: I92317d8f5a6d6f60160139f7486ffa8ec5985656 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* No longer apply pending changes when accessing ItemView propertiesAlan Alpert2013-04-261-7/+6
| | | | | | | | | | | | | Applying changes in the getters can lead to binding loops, and is currently inconsistently applied. Removing the applyPendingChanges calls from remaining getters, and adding a forceLayout() function for cases where the immediate-apply behavior is needed. Task-number: QTBUG-30555 Parts-of-patch-by: Albert Astals Cid Change-Id: I64632601e02f2a53060296ab7739577a749d916f Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au> Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
* Fix lupdate-warning "Cannot invoke tr() like this".Friedemann Kleint2013-04-231-1/+1
| | | | | Change-Id: I3ded3d9ab9fa202a3133c53fd6e17a8354481d0c Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Merge branch 'dev' into stableSergio Ahumada2013-03-201-48/+68
|\ | | | | | | | | | | This starts Qt 5.1 release cycle Change-Id: I6178a580b4c99aded1a69032a02169cff502b71d
| * Fix displacement transition bug for horizontal caseGuenter Schwann2013-03-111-1/+1
| | | | | | | | | | | | | | Task-number: QTBUG-29944 Change-Id: I23381f7a1d2c8d3c6df007b5b11c12b0db3bb1e9 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * Move the model classes from QtQuick to QtQmlAlan Alpert2013-01-241-47/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed for proper support of non-GUI instantiators in QtQml. Only private C++ classes are affected. Aside from name changes, model classes now operate on QObjects instead of QQuickItems, leading to minor changes in the implementation of QtQuick classes using them. The old QML type names will still be registered in the QtQuick import for the forseeable future, but pointing to the new classes. The new QML types will be added in a second commit. Classes Affected: QQuickVisualDataGroup -> QQmlDataGroup QQuickVisualDataModel -> QQmlDelegateModel QQuickVisualItemModel -> QQmlObjectModel QQuickVisualModel -> QQmlInstanceModel QQuickChangeSet -> QQmlChangeSet QQuickListAccessor -> QQmlListAccessor QQuickListCompositor -> QQmlListCompositor QQuickPackage -> QQuickPackage (just moved for now) Change-Id: Ia19e630e53bfa9e5d459e289596cd11df1ea3930 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* | QQuickItemView: Add guard before returning currentItem itemCaroline Chao2013-03-191-3/+1
|/ | | | | | | | | | | | | And don't check if the currentItem is empty before calling applyPendingChanges(). And an autotest. (Patch from Steffen Imhof) Task-number: QTBUG-30227 Change-Id: Ia16362a6d0dce771f20772929c32e9306ed0e0f9 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> 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>
* Renamed QQuickItem::pos property to positionShawn Rutledge2012-11-291-1/+1
| | | | | | | | | Abbreviated property names are less descriptive so we don't have many of them. Might as well be consistent. QWindow::pos was already renamed. Change-Id: Ib52673e68e7dc902b2f8942dba6b899074b2538b Reviewed-by: Samuel Rødal <samuel.rodal@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>
* Add SnapPosition mode to positionViewAtIndex() in List/GridView.Martin Jones2012-07-271-1/+25
| | | | | | | | | | This allows the view to be positioned on a snap boundary, which is generally what is wanted when strict highlight mode s set or snapping is enabled. Task-number: QTBUG-26605 Change-Id: I6288dc8be4ff16c412b56ab449b6a9fb7b7ea889 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Changing model after componentComplete should reset currentIndexMartin Jones2012-07-231-12/+3
| | | | | | | | When the model is changed reset currentIndex back to 0. Task-number: QTBUG-26604 Change-Id: I1934e083819537d416acd85c75362daff382aa04 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Fix item positioning with multiple removes before the visible area.Andrew den Exter2012-07-131-3/+4
| | | | | | | | | The index of the previous first visible item needs to be adjusted when items are removed before it in order to comparable against later changes. Change-Id: I3c72abb4dfc9c2ccc9b299dda186ecdc3994a735 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Section headers ignore list delegate size changes when "colliding"Martin Jones2012-07-041-16/+11
| | | | | | | | Make section header updates part of the layout process. Task-number: QTBUG-23298 Change-Id: I4586bc58bc195fcc47f6db79346727eb6e3d3845 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Fix crash when dragging items outside visible area.Andrew den Exter2012-06-221-38/+24
| | | | | | | | | | | | | | | | | | If asynchronous item creation finishes while the content area of a ListView has been dragged full outside the visible area a full refill is triggered which can overwrite the requested index and potentially result in a single delegate item being assigned to multiple view items and later being doubly released. Only create the view item object in the createItem function to prevent this from happening. Secondly only reset the visible items if jumping outside the buffer range rather than just the fill range to prevent churn when the list only contains buffered items. Task-number: QTBUG-26232 Change-Id: I5bce845898ef5f699f34afc268594ef38e01d6a3 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Rename Flickable x/yOrigin to originX/YBea Lam2012-06-221-4/+4
| | | | | | | | This is consistent with the naming of other x/y properties, e.g. contentX/Y, relativeX/Y etc. Change-Id: I5159f8e54a6fda6a1f83a563ea9db47c3b8af238 Reviewed-by: Martin Jones <martin.jones@nokia.com>