summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems/qdeclarativelistview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Regression: currentIndex was not set correctly after model cleared.Martin Jones2011-03-151-2/+4
| | | | | | | | | | Change b3080d78f2ff2d98410249e09d5d7d6e20fd155c stopped the currentIndex from being updated when a new item is added to an empty view. Change-Id: I77a0789fcf3693034a2d7aca173fec669b913b18 Task-number: QTBUG-18123 Reviewed-by: Bea Lam
* Fix ListView boundary extents for RTL layout.Martin Jones2011-03-111-9/+39
| | | | | | | | | The delegates were laid out RTL, but the first item was not aligned with the right edge. Also fixes QTBUG-18037. Change-Id: I6387c2f1ad37385376304f8cc76407b34d9fb834 Task-number: QTBUG-16010 Reviewed-by: Joona Petrell
* Fix documentation talking about old property LayoutMirror::mirrorJoona Petrell2011-03-071-1/+1
| | | | | | | Task-number: QTBUG-11042 Reviewed-by: Bea Lam Change-Id: I3f842b7672ee57dadbd1ed9216249c36aa527d6a
* Merge branch '4.7' into qtquick11Martin Jones2011-03-011-19/+47
|\ | | | | | | | | | | | | Conflicts: src/declarative/graphicsitems/qdeclarativelistview.cpp Change-Id: Ic21311365c6139520ae337a379bdedb6ffe497db
| * Drag over bounds errors when ListView has variable height contentMartin Jones2011-02-281-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two related problems: - when dragging variable height content up beyond bounds items are destroyed, causing the maximum extent to change, which in turn causes skipping. This is fixed by storing the extents on press so that later changes do not affect drag behavior. - when variable height content is dragged beyond the bounds and and released, items are created as the view returns to bounds. This changes the extents, however the bound target was not updated. If the viewport height changes during fixup the bounds animation is now updated. Change-Id: Ib37ec9e51f8ceb71af1e2e58f25fd8da18dcd632 Task-number: QTBUG-17769 Reviewed-by: Michael Brasser
| * fix/improve docs for new QtQuick 1.1 attributesBea Lam2011-02-281-0/+1
| | | | | | | | | | | | | | | | | | Ensure attributes added in QtQuick 1.1 are marked with the '\since QtQuick 1.1' tag. Also add links to items listed in the QtQuick 1.1 section in whatsnew.qdoc. Task-number: QTBUG-17771 Change-Id: Ic8fb3c8d3c99a1469c1767779efaafd27ef460e1
| * Ensure layout is updated when section property changes.Martin Jones2011-02-251-1/+4
| | | | | | | | | | | | | | | | | | | | | | When the section property changed the sections were recalculated, but the items were not relayouted. Also avoid 'Unable to assign undefined value' warning by setting section item parent before component is completed. Change-Id: I7bd8eb369877a6faf72b32b80b45a68366c95772 Task-number: QTBUG-17759 Reviewed-by: Michael Brasser
| * DelayRemove of list delegate on section boundary duplicated sectionMartin Jones2011-02-231-8/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When removing a delegate with a removal animation that fell on a section boundary (i.e. owned the section header), the following item would also create a section header before the previous item was removed. Make updateSections() include the removed, but visible items in its update. Ensure updateSections() is called when the removed item is destroyed to ensure a new section header is created at that point. Change-Id: Ie831e3acf65b2989ebb030e2ab38cdbe179a9d45 Task-number: QTBUG-17606 Reviewed-by: Michael Brasser
| * ListView and GridView indexAt should use qreal coordinates.Martin Jones2011-02-231-2/+2
| | | | | | | | | | | | Change-Id: Ibe6969b5c3209062213c6582eaf4c285bcb793de Task-number: QTBUG-17594 Reviewed-by: Bea Lam
* | Add LayoutMirroring attached property for mirroring QML layoutsJoona Petrell2011-03-011-23/+67
| | | | | | | | | | | | Task-number: QTBUG-17280 Reviewed-by: Martin Jones Change-Id: I34a623b49ce0fd5c05ae7a7ea5d0437c107b8a9b
* | GridView and ListView bug fixesChristopher Ham2011-02-171-8/+8
| | | | | | | | | | | | | | | | | | | | | | ListView and GridView check before accessing an empty model. Fixed issue with undefined header. Current index initialised properly when dynamically creating ListModel items with javascript. Change-Id: I121c0626db6eb7ccaab689dfc750e0d03773d90f Task-number: QTBUG-15877 Reviewed-by: Joona Petrell
* | Righ-to-left support for GridView and ListViewChristopher Ham2011-02-151-89/+296
|/ | | | | | | | | GridView and ListView can now be laid out right-to-left. The behaviour should be identical and mirrored to the oridinary behaviour. Change-Id: I8e55c5f88358042caa5201712ef239cd67628172 Task-number: QTBUG-15877 Reviewed-by: Joona Petrell
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7Bea Lam2011-02-091-2/+7
|\ | | | | | | | | | | | | Conflicts: tests/auto/declarative/qdeclarativemoduleplugin/qdeclarativemoduleplugin.pro Change-Id: I8da521f05ebc266d91caa582852155b571d5cc63
| * Changing header/footer size during creation caused recusionMartin Jones2011-02-071-2/+4
| | | | | | | | | | | | | | | | | | | | | | If the size of the header or footer was changed during creation it would trigger itemGeometryChanged() which called updateHeader() and updateFooter() thereby causing recusion. We should only call those methods if the header/footer is already created. Change-Id: Ia2ae4047d745d1f301d243278550e65854fa830a Task-number: QT-4439 Reviewed-by: Joona Petrell
| * Ensure section delegates are updated when the section property changes.Martin Jones2011-02-071-0/+3
| | | | | | | | | | | | | | | | | | If the section property changes and the existing section delegate is reused the section property in the delegate must be updated. Change-Id: I6c3dcdb697e80e1ab5162a179da52e0a0f41144c Task-number: QTBUG-17068 Reviewed-by: Bea Lam
* | Call onAdd() for first items added to ListView and GridViewBea Lam2011-02-091-19/+10
|/ | | | | | | | | | | | The bug was caused by the fact that the itemsInserted() implementation in ListView and GridView returned early for cases where (model->count() <= 1) and so did not call onAdd() unlike for other cases. This change also fixes some incorrect values in the header() and footer() unit tests for ListView and GridView. Change-Id: I24f5c86afcd62c26e17b0932f257f4767a287b8e Task-number: QTBUG-15642 Reviewed-by: Martin Jones
* Changing header or footer failed to delete the previous.Martin Jones2011-02-021-0/+8
| | | | | | | | Also ensure that the view is repositioned if the change of header results in the view being out of bounds. Task-number: QTBUG-16522 Reviewed-by: Michael Brasser
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into qtquick11Bea Lam2011-01-271-2/+2
|\ | | | | | | | | | | Conflicts: src/declarative/graphicsitems/qdeclarativegridview.cpp src/declarative/graphicsitems/qdeclarativelistview.cpp
| * positionViewAtIndex can fail when positioned near end of list.Martin Jones2011-01-211-2/+2
| | | | | | | | | | | | | | | | | | We positioned the view beyond the bounds, which in some cases resulted in only one item being created. Combined with a bug in the bounds fixup very many items were created. Task-number: QT-4441 Reviewed-by: Michael Brasser
* | Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into qtquick11Martin Jones2011-01-191-1/+1
|\ \ | |/
| * Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Remove unnecessary debug traces from declarative classesJoona Petrell2011-01-171-1/+0
| | | | | | | | | | Task-number: Reviewed-by: Martin Jones
* | Add methods to position view at beginning or end.Martin Jones2011-01-111-58/+108
|/ | | | | | | Takes into account header/footer. Task-number: QTBUG-16213 Reviewed-by: Michael Brasser
* Improve docs on attached properties on view delegates.Martin Jones2010-12-231-0/+7
| | | | | | | | Clarify that the properties are attached to the root of the delegate, and must be accessed as such by child items. Task-number: QTBUG-16193 Reviewed-by: Bea Lam
* Removing all visible items in ListView resulted in blank view.Martin Jones2010-12-221-4/+10
| | | | | | | | | When delayRemove is true and all visible items are tagged to be removed the visibleIndex became invalid and refill() began filling from 0. Task-number: QTBUG-16183 Reviewed-by: Michael Brasser
* Ensure ListView contentHeight is set to a valid size.Martin Jones2010-12-131-0/+6
| | | | | | | | | If the view height is 0 no items will be created so the contentHeight can not be estimated. The currentItem is usually created, so it is possible to use that to estimate. Task-number: QTBUG-16037 Reviewed-by: Bea Lam
* highlightFollowsCurrentItem: false was not always honoredMartin Jones2010-12-091-6/+12
| | | | | | | | In some cases ListView and GridView would position the highlight despite highlightFollowsCurrentItem: false being specified. Task-number: QTBUG-15972 Reviewed-by: Michael Brasser
* ListView: Fix calculation of currentItem position when out of view.Martin Jones2010-12-081-4/+8
| | | | | | | | The calculation of position of currentItem when it is out of the visible area was bogus. Task-number: QTBUG-15525 Reviewed-by: Bea Lam
* ListView header is not visible initially.Martin Jones2010-12-011-7/+15
| | | | | | | | | If the header size was not set explicitly, but determined implicitly from Text height, the view was not positioned so that the header was visible when first shown. Task-number: QTBUG-15599 Reviewed-by: Bea Lam
* Ensure header is considered when positioning content with snapping.Martin Jones2010-11-301-1/+5
| | | | | | | | | When snapping is enabled the header was ignored and content would be aligned with the first item rather than the header, when at the top of the view. Task-number: QTBUG-15710 Reviewed-by: Bea Lam
* Avoid lockup in ListView when animating delegates.Martin Jones2010-11-241-0/+8
| | | | | | | | | | Animating delegates results in the content height changing, which may result in fixup being called if at the ends of the view, which may in turn cause refill to be called, which will change the content height, which repeats. Prevent this recusion from happening. Task-number: QTBUG-14821 Reviewed-by: Bea Lam
* ListView: items with size < 1.0 were layed out incorrectly.Martin Jones2010-11-151-3/+3
| | | | | | | | If the size of an item was less than one its endPosition() was less than its position(), which caused incorrect layout (overlapping items). Task-number: QTBUG-15242 Reviewed-by: Yann Bodson
* ListView.SnapToItem with ListView.StrictlyEnforceRange is broken.Martin Jones2010-11-151-34/+20
| | | | | | | | | The bounds behavior with ListView.StrictlyEnforceRange enabled should not be affected by snapping behavior in fixup() since ListView.StrictlyEnforceRange has a stronger positioning policy. Task-number: QTBUG-15329 Reviewed-by: Michael Brasser
* Fix regression in 648eb76c and update visual tests.Martin Jones2010-11-041-0/+1
| | | | | | | Once fixup() begins, flick should not be recalculated. Task-number: QTBUG-14821 Reviewed-by: Michael Brasser
* Combining ListView.StrictlyEnforceRange and resizing currentItem stalls.Martin Jones2010-11-031-37/+25
| | | | | | | | | There were two problems. 1) layout() called fixup() was called while the view was being flicked. 2) the snapping code was incorrect (and duplicated). Task-number: QTBUG-14821 Reviewed-by: Michael Brasser
* Run util/normalize on src/declarative.Yann Bodson2010-10-261-2/+2
|
* Ensure we don't refill the view before all model changes are complete.Martin Jones2010-10-201-11/+14
| | | | | | | | | Calling setPosition(0) in itemsRemoved caused the view to be refilled, which is a bad thing if the model has changed but not all updates have been handled. Fixed in both ListView and GridView. Task-number: QTBUG-14548 Reviewed-by: Michael Brasser
* ListView item insertion didn't handle delayed item removal correctly.Martin Jones2010-10-201-30/+4
| | | | | | | | | The delayed removal items weren't handled correctly by mapRangeFromModel() function. Use mapFromModel() instead which gives us what we actually want and remove unused mapRangeFromModel(). Task-number: QTBUG-14471 Reviewed-by: Michael Brasser
* Fix consistency of setting currentIndex in ListView and GridView.Martin Jones2010-10-141-11/+24
| | | | | | | | | | | The behaviour of setting the currentIndex out of bounds, was different depending upon whether it was set -ve, beyond the end, or before component completed. The behaviour is now consistent - setting the currentIndex out of bounds is allowed and will cause the currentItem and highlightItem to become null. Task-number: QTBUG-12571 Reviewed-by: Michael Brasser
* Update sections if model content changes.Martin Jones2010-10-121-3/+37
| | | | | | | | We didn't handle the section property changing, e.g. due to asynchronous model. Task-number: QT-4093 Reviewed-by: Aaron Kennedy
* emit currentSectionChanged when section changes in ListView.Martin Jones2010-10-081-3/+12
| | | | | Task-number: QTBUG-13981 Reviewed-by: Michael Brasser
* Avoid potential null dereference.Martin Jones2010-10-041-1/+1
| | | | Task-number: QT-4030
* Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7David Boddie2010-09-151-0/+2
|\
| * Ensure flickable velocity is updated when view is moved by setCurrentIndexMartin Jones2010-09-131-0/+2
| | | | | | | | Task-number: QTBUG-13543
* | Doc: More work on the declarative API documentation.David Boddie2010-09-131-5/+8
|/
* Merge branch '4.7' into qmldocsDavid Boddie2010-09-071-15/+56
|\
| * ListView: Ensure highlight is positioned correctly in positionViewAtIndex().Martin Jones2010-09-071-15/+56
| | | | | | | | | | | | | | Also update the currentItem position during flicking and avoid resizing the highlight on section boundaries. Task-number: QT-3870
* | Merge branch '4.7' into qmldocsDavid Boddie2010-09-061-3/+7
|\ \ | |/
| * Keep ListView position sensible when all visible items are removed.Martin Jones2010-09-031-3/+7
| | | | | | | | | | | | | | Previously it would always jump back to 0. Now it stays at the nearest remaining index. Task-number: QTBUG-12664
* | Doc: qdoc fixes.David Boddie2010-09-021-1/+1
|/