aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitemview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Set a non-zero default cacheBuffer.Martin Jones2012-06-131-1/+6
| | | | | | | | | | The likelihood of constant framerate when flicking is considerably improved by having a cacheBuffer. Since there is only a minimal cost in having a modest cacheBuffer, it is better to have a more optimal default value - 320 seems a good starting point. Change-Id: Id3c8a153821573b5b08c6fbd80d34152908d358d Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Fix view delegate parent binding regression.Martin Jones2012-06-121-0/+1
| | | | | | | | | | | | 762b4d90110465aeceb96f44cd06dcda229dfe89 introduced a regression by setting the item parent after completion. This was to avoid rendering an incubated object before completion. However this breaks bindings. Restore setting the item parent before completion, and ensure items are not rendered until completed. Change-Id: Ifc9d0c34ee62e687889c32ffab7c091b4c8cc470 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Performance should always be better with cacheBufferMartin Jones2012-06-081-7/+16
| | | | | | | | | | | | | Setting a cacheBuffer introduced more work for the scenegraph due to cached delegates' visibility being toggled. Changing visibility is expensive as it is proagated to all children. Introduce a cheap method of hiding a branch instead. Also avoid initiating incubation in the same frame as a completed creation. Change-Id: I573bcf37f441f96a7502d445be50ef4301f217d5 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Remove unused performance flags.Michael Brasser2012-06-061-1/+0
| | | | | | Change-Id: I9a9111703e2480af02b1af7033ea6bb12e7a75a5 Reviewed-by: Glenn Watson <glenn.watson@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Clearing a view didn't reset content size.Martin Jones2012-05-311-7/+6
| | | | | | | | Ensure that a valid contentHeight/contentWidth is set regardless of whether there is a valid model. Change-Id: I546683c7571a1379e3ca2ef285435ad48319e8e4 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Initialize data members in quick.Martin Jones2012-05-291-0/+1
| | | | | | | Found by static analysis. Change-Id: Ide1ce1d7964655664dc872de6da9962a281e229c Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Don't parent (QObject) delegate items to views.Andrew den Exter2012-05-281-2/+0
| | | | | | | | | | | | This keeps object ownership within the context the items were created in and simplifies lifetime management as the VisualDataModel has sole license to delete objects and doesn't have to keep guards against a view and all it's children being deleted. Delegates are still reparented in the item heirarchy. Change-Id: Ife5afdfe294a5a8ca1ca3638a086f72452e4915c Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Don't override "z" bindings for header and footerBea Lam2012-05-281-3/+6
| | | | | | | | | | Headers and footers are given a default z value. This value should be set between Component beginCreate() and completeCreate() to avoid overwriting any binding in the header or footer item that has already set the 'z' value. Change-Id: I8e3ee97232d99500a32f2d77d2b663016eb404f7 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix xOrigin and yOrigin to always be top-left posBea Lam2012-05-141-8/+12
| | | | | | | | | | Currently xOrigin is reversed for right-to-left and yOrigin is reversed for bottom-to-top. This is wrong since xOrigin and yOrigin come from Flickable so they should keep that meaning, i.e. the top left corner of where the content begins, in ListView and GridView. Change-Id: I88c77fadd1cf784f4b4d62677168b84675e921b0 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Move check for whether a layout is already in progressBea Lam2012-05-091-11/+13
| | | | | | | | Move it out of applyModelChanges() into layout() since that's where it should really be checked. Change-Id: I24093e91e2ffadd5377ba44128168939e5db54c9 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Only run populate for items in model at creationBea Lam2012-04-231-2/+4
| | | | | | | Don't run for items added in Component.onCompleted. Change-Id: I58745ab989efae168d036875cb2fb88e3e2db0c3 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Don't initiate delegate incubation in delegate creation frames.Martin Jones2012-04-201-6/+13
| | | | | | | | If we've just instantiated a synchronous delegate, don't schedule a buffered delegate until the next frame. Change-Id: Id269457cb74a7900e4405022c15148fd2a3dc180 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Vertical layout direction for ListView and GridViewBea Lam2012-04-171-112/+137
| | | | | | | | Provide verticalLayoutDirection property with TopToBottom and BottomToTop values. Change-Id: If6f0da5dd4735036162868d391852a661854de5b Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Don't ignore model changes when the ListView scroll position changes.Andrew den Exter2012-04-131-3/+3
| | | | | | | | | If there are pending changes when the ListView viewport changes then do a full layout instead of a refill. Likewise for GridView and when animations finish or the cacheBuffer size changes. Change-Id: I57a2b01fee5729381558af366dad24ba26c223ef Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Buffer changes received during layout()Bea Lam2012-03-271-3/+29
| | | | | | | | Otherwise, changes received by a view during layout() may override the changes that are currently being processed. Change-Id: Iabc4db682f85ceb7d04c3f7442fb6c98ebdb94f1 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Fix margins for right-to-left modeBea Lam2012-03-211-7/+5
| | | | | | | | | | | | | | | The behaviour for considering left and right margins was inconsistent in views with a right to left layout; these values were reversed for extent calculations but not for general positioning. With this change the left and right margins are never reversed in a right-to-left layout, so minXExtent and maxXExtent calculations always use startMargin and endMargin respectively, regardless of layout direction. Also fixes calculation of endOffset in trackedPositionChanged() when in horizontal orientation. Change-Id: Ie00e3d4c2bd38d8fe6ac0213702206b88bfa895e Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Resetting a model can cause a crash in views with header/footer.Martin Jones2012-03-191-7/+4
| | | | | | | Geometry listeners were called for deleted header/footer. Change-Id: I47854178232f8a4ab5e19a931901b49741fec388 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Don't crash view while changing model.Martin Jones2012-03-191-1/+1
| | | | | | | | | Set model to null before adjusting view position, as changing position can trigger a refill() if the view is animating at that instance. Change-Id: I4bc20766b1ab906799213b149c84a1bdb268c200 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* ListView.contentHeight does not include header and footer item heightsMartin Jones2012-03-131-2/+3
| | | | | | | Task-number: QTBUG-24664 Change-Id: I2a2fe144835e61665b8693d58ca4fb9ba506e8a8 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* refilled items should be moved immediatelyBea Lam2012-03-101-2/+2
| | | | | | | | | refill() functionality should reposition items immediately, else removeNonVisibleItems() sees different positions from those added in addVisibleItems() if an item is animating. Change-Id: Ib9904e08bf92b18fd4b712270c0ab69e9a113e04 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Avoid using QQuickViewItem as base classBea Lam2012-03-101-19/+86
| | | | | | | | | | This patch renames it to QQuickItemViewTransitionableItem, and FxViewItem and PositionedItem now create instances of this instead of subclassing it, to reduce the memory used when transitions are not required. Change-Id: Ie050cda5a121bff9542c7ba7356f6eacf37d241a Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Fix setting of target lists when target Transition is not setBea Lam2012-03-071-47/+12
| | | | | | | | | | | Target items are now set from QQuickViewItem::prepareTransition() instead of QQuickItemView and QQuickPositioner to ensure they are for a displaced transition even if there is no matching target transition. Task-number: QTBUG-24535 Change-Id: I0a6c7e3c6198786527014d421b96fc562c6186dc Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Merge master <-> api_changesMatthew Vogt2012-03-051-773/+148
|\ | | | | | | Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
| * Fix crash when transition finishes after view is deletedBea Lam2012-03-011-0/+2
| | | | | | | | | | Change-Id: I5bb525bab735536fa7ae3a7f60bf775cd93cf3c1 Reviewed-by: Martin Jones <martin.jones@nokia.com>