aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitemview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Section header is not made visible when changing currentIndex.Martin Jones2012-02-071-3/+5
| | | | | | | | | Make section header visible when setting currentIndex to an item on a section boundary. Could also affect initial position if view size started at 0. Change-Id: Ie65f91826311d34a290d369d8956f1c88f7efb70 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Incorrect initial pos after resizing view with margins.Martin Jones2012-02-021-19/+26
| | | | | | | | | | The currentItem tracking didn't position the view to show the margins. This affects resizing the view and also changing currentIndex. Task-number: QTBUG-24028 Change-Id: I47d4c771c0d712c93abadfb6b2deb5194241fb6b Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Must update columns when GridView geometry changesBea Lam2012-02-021-0/+3
| | | | | | | | | | Regression from changes in 80d85e0017cb5cc4b0a0df6c19d4126bf5062731 Also remove shared duplicate code in visibleItemsChanged() in ListView and GridView. Change-Id: Ic3ab3ba070ddf9901a232ed5b3250c725797cf69 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fixes for removing before visibleBea Lam2012-02-011-4/+10
| | | | | | | | | | | | | Account for removing multiple items over visible and non-visible items and calculate these using the index of the first visible item rather than the visibleIndex (which can be above the visible position). Also, don't take the changeBeforeVisible into account if the first visible is already being adjusted, otherwise it moves back one more row than it should. Change-Id: Iea7247102e06697d10eb41301ca689c0cdc35ece Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: If39bd256b0fa85eba17ea30f8ab87ea27d758908 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I6a730abc0c396fb545a48b2d6938abedac2e3f1c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Fix lockup in views due to endless polish loop.Martin Jones2012-01-201-44/+37
| | | | | | | | | | | | | It was possible to cause an endless polish loop in some rare cases. Eliminate all calls to polish() within existing polish() code paths. Cleanup delegate creation and cancelling in the cacheBuffer area. Adjust first item position correctly when inserting/removing before visibleItems list. Change-Id: I508a2e6de8cb09d904466cbf5fb6b5dfd1e89c49 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Insertions were calculating wrong insertion posBea Lam2012-01-181-44/+70
| | | | | | | | | | | | | | | | | | | | | | | After removes, and after each insertion, the view must adjust the visibleItems.first() position and call layoutVisibleItems() to ensure that the correct insertion position is calculated for insertions that follow. When applyInsertionChange() in GridView and ListView calculates the position for item insertion, it looks at the current positions of the items in visibleItems, so these positions must be updated prior to this calculation. Otherwise, insertions that follow a remove may not calculate this position correctly and will neglect to add some items, and multiple insertions may unnecessarily create items at positions that are not actually visible. resetFirstItemPosition() is changed to take a set position and it replaces resetItemPosition() since it can do the same thing. Task-number: QTBUG-23610 QTBUG-23609 Change-Id: I8839ee7d15853301435e80c0dc563f93fc3605cf Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Handle views with negative width/heightMartin Jones2012-01-161-3/+7
| | | | | | | | | A view with a negative d->size() would get stuck in an infinite loop. Also make sure item layout/visibility is updated when the view size changes. Change-Id: I1f16a714ecebe1c4b71902c460e27fb0f1c4406f Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Fix positioning issues and change content y repositioning behaviourBea Lam2012-01-091-89/+96
| | | | | | | | | | | | | | | | | | | | | | | Refactor the code for re-positioning the visibleItems.first() in QSGItemView::applyModelChanges() and fix various positioning issues. The positioning behaviour for removing items at the start of the view has changed. This action will no longer cause the content y to move down; previously the content y would always move down unless another item was moving backwards to the first visible position. This will make it easier to implement built-in removal transitions for the views, since removed items cannot be animated if the content y jumps down past them. Additionally, moving items from before a GridView should not cause the top item in the view to move upwards and out of the view. This also adds additional remove tests and fixes the tst_QQuickGridView::moved() test which wasn't waiting for the polish event after setting the content y, which caused some of the tests to pass even though their test data was wrong. Change-Id: Idad11a73a18f88208e73a52111ed839458e05f2d Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add itemAt(x,y) function to GridView and ListView.Martin Jones2012-01-061-0/+12
| | | | | | | Task-number: QTBUG-21592 Change-Id: I3169e789da701ce261250421239584abd7f29b57 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I0a8d99909cac867dce72da70b1bbcb649989a51b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Ensure items in ListView and GridViews viewport are visible.Andrew den Exter2011-12-201-0/+1
| | | | | | | | | Unrequested items and items in the cache buffer are hidden by the views. Make these items visible again if they enter the viewport due to a relayout. Change-Id: I574d1513e88c31c3c01a4a20ac77c21111279d3e Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Say hello to QtQuick moduleKent Hansen2011-12-021-0/+1732
This change moves the QtQuick 2 types and C++ API (including SceneGraph) to a new module (AKA library), QtQuick. 99% of this change is moving files from src/declarative to src/quick, and from tests/auto/declarative to tests/auto/qtquick2. The loading of QtQuick 2 ("import QtQuick 2.0") is now delegated to a plugin, src/imports/qtquick2, just like it's done for QtQuick 1. All tools, examples, and tests that use QtQuick C++ API have gotten "QT += quick" or "QT += quick-private" added to their .pro file. A few additional internal QtDeclarative classes had to be exported (via Q_DECLARATIVE_PRIVATE_EXPORT) since they're needed by the QtQuick 2 implementation. The old header locations (e.g. QtDeclarative/qquickitem.h) will still be supported for some time, but will produce compile-time warnings. (To avoid the QtQuick implementation using the compatibility headers (since QtDeclarative's includepath comes first), a few include statements were modified, e.g. from "#include <qsgnode.h>" to "#include <QtQuick/qsgnode.h>".) There's a change in qtbase that automatically adds QtQuick to the module list if QtDeclarative is used. Together with the compatibility headers, this should help reduce the migration pain for existing projects. In theory, simply getting an existing QtDeclarative-based project to compile and link shouldn't require any changes for now -- but porting to the new scheme is of course recommended, and will eventually become mandatory. Task-number: QTBUG-22889 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Change-Id: Ia52be9373172ba2f37e7623231ecb060316c96a7 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>