aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qsglistview
Commit message (Collapse)AuthorAgeFilesLines
* Rename Qt Quick-specific classes to QQuick*Kent Hansen2011-10-2131-5556/+0
| | | | | | | | | | | | | | | | | | | | | | The QSG (SceneGraph) prefix is too generic for Qt Quick(2)-specific classes. All the classes and files in the declarative/items directory have been renamed. In particular, for classes that are currently public, the renaming is as follows: QSGView --> QQuickView QSGCanvas --> QQuickCanvas QSGItem --> QQuickItem QSGPaintedItem --> QQuickPaintedItem The header files have been renamed accordingly (e.g. qsgview.h --> qquickview.h). Change-Id: Iac937fff81db20bb639486a793c3aeb5230b038c Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Unit test for QTBUG-21742Damian Jansen2011-10-212-2/+52
| | | | | | | Test for crash when accessing a ListView in an odd way. Change-Id: I47dd8f4eaa2990c6842cf95a62ce925edac26f9a Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
* Remove copy of tests/shared/util.h.Jason McDonald2011-10-191-1/+0
| | | | | | | | | This module has a copy of qtbase's tests/shared/util.h, the contents of which have been moved into qtestlib and are now accessible from the QtTest/QtTest header. Change-Id: I0be9e21dc9f30629dad283a740b9d80347e01140 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix coding style issuesKent Hansen2011-10-171-13/+13
| | | | | | | Avoid Qt Sanity Bot noise when these files are moved. Change-Id: I714e949837909883fe7e387ae336d2ffc4a1912b Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Fix GridView to repaint when geometry changesBea Lam2011-10-172-0/+56
| | | | | | Task-number: QTBUG-22078 Change-Id: Ic0ad67832dad9a7b3a7e5501893befe2d30b6c94 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Fix testsBea Lam2011-10-171-2/+2
| | | | | | | | Fix referenced test data file and don't wait so long for move to process Change-Id: I55571e99015f2799a231365532aa1778e148f9e5 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Cannot flick to the end of a horizontal ListView with LayoutMirroringMartin Jones2011-10-172-0/+166
| | | | | | | | | | | | | | | Forward port of fix for QTBUG-21756. minXExtent calculated the offset due to highlight range incorrectly (reversed) when mirroring enabled. Also us same algorithm for fixup() in GridView and ListView uses. For QtQuick 2, this change also reverses the beginning and end highlight range, as it should be, i.e. the preferredHighlightBegin is from the right side in RightToLeft mode. Also added snapping tests. Task-number: QTBUG-21756 Change-Id: Ica0ba4ab5db0ce9c77f2da75e9f8293550bd37d1 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Fix insertions above the visible indexBea Lam2011-10-141-0/+179
| | | | | | | | | | | | | | | | | The first visible item was repositioned incorrectly after an insertion above the visible index since any insertions above the position + cache buffer were ignored and not considered for repositioning the first item. GridView insertion code has changed to be similar to the ListView implementation to fix various issues when inserting above the visible index and to remove code that crossed indexes from visibleItems with model indexes and visible indexes. Also adds extra insertion tests for ListView and GridView. Change-Id: I5e129c605fdad733b61bd29850465b3b752fb63f Reviewed-on: http://codereview.qt-project.org/6485 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Use TESTDATA macro in declarative tests.Michael Brasser2011-10-142-51/+53
| | | | | | | | | Includes a few other minor cleanups as well. Task-number: QTBUG-21721 Change-Id: I5b1c2c116e63748c6b4199183212de8a00037af1 Reviewed-on: http://codereview.qt-project.org/6473 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* tests: eliminated usage of qttest_p4.prfRohan McGovern2011-10-111-4/+3
| | | | | | | | | | | | | | qttest_p4.prf was added as a convenience for Qt's own autotests in Qt4. It enables various crufty undocumented magic, of dubious value. Stop using it, and explicitly enable the things from it which we want. Since QT+= had to be touched already, this change also removes a lot of useless duplication on those lines. Change-Id: I9f2f20eaf4a0e676beddf474c7db8680e4712f78 Reviewed-on: http://codereview.qt-project.org/6302 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Fix ListView components being unable to access context properties.Andrew den Exter2011-10-073-1/+44
| | | | | | | | | | | Where avaialable use the components creation context instead of the views context as the root context for the new item. Task-number: QTBUG-21865 Change-Id: I07e564548de57d58413dc0d7cd151bd8a90886e7 Reviewed-on: http://codereview.qt-project.org/6199 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Fix waiting for active window breakageMartin Jones2011-10-072-10/+3
| | | | | | | | | | Use QTRY_COMPARE(view == qGuiApp->focusWindow()); Change-Id: If5934f4355d9eb8da343f98277e3528f56926cd9 Fixes: QTBUG-21682, QTBUG-21683, QTBUG-21687, QTBUG-21680 Reviewed-on: http://codereview.qt-project.org/6087 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Mark failing tests as insignificant.Toby Tomkins2011-10-051-1/+1
| | | | | | | Change-Id: I5aa4d13fb44c2ec184d405b075d71244782247a9 Reviewed-on: http://codereview.qt-project.org/6007 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* currentIndex not updated correctly if list is initially emptyBea Lam2011-10-032-1/+43
| | | | | | | | | | | The currentIndex shouldn't be incremented when itemCount == 0 and also it should be default to 0 after the first item is added. Task-number: QTBUG-21643 Change-Id: Ia9418c0cd1cd659410123394c880dfe72557fa16 Reviewed-on: http://codereview.qt-project.org/5768 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Don't move content forwards when items are moved downBea Lam2011-10-031-3/+8
| | | | | | | | | | | | | | | | | | | | Previously, if items moved down within a view, the content position would effectively drop down. E.g. for a (0,5,3) move that moved 3 items from 0 to 5, the content y would move to the position of index 3, since it became the new first item. However, this makes it difficult to move transitions for move() operations in these cases since these items do not move (since the content position moves instead). With this fix, the content position does not move, and items will always move if they are moved. Note this behaviour was previously implemented for backwards movements, e.g. a (5,0,3) move but was not enabled for a forwards (0,5,3) move. Change-Id: I1c5a19e3c36347a4aa0cf6e31c975967a7eeada9 Reviewed-on: http://codereview.qt-project.org/5576 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove Symbian-specific code from tests.Jason McDonald2011-09-302-12/+1
| | | | | | | | | | Symbian is not a supported platform for Qt5, so this code is no longer required. Change-Id: I5cb6d3b41fbb9fa5fea6176ad949e4e7be7c30b5 Reviewed-on: http://codereview.qt-project.org/5767 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix tst_QSGListView::sectionsPositioning() testMartin Jones2011-09-291-3/+3
| | | | | | | Change-Id: Ifdf43d43c4cb6f04798ee7ef93d7fa6dd5589640 Reviewed-on: http://codereview.qt-project.org/5669 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* [autotests] Added expected failure for developer build in currentIndex test.Toby Tomkins2011-09-281-0/+3
| | | | | | | | | Task-number: QTBUG-21682 Change-Id: Icbe3ef45c9c58b54c195993b837713aef1dd3ca2 Reviewed-on: http://codereview.qt-project.org/5571 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Support margins in Flickable.Martin Jones2011-09-262-0/+110
| | | | | | | | | | | It is sometimes desireable to leave a margin/add decoration around the content of a Flickable. This adds topMargin, leftMargin, bottomMargin rightMargin, xOrigin and yOrigin properties to Flickable. Task-number: QTBUG-21362 Change-Id: Ia24ea4c63e7a8de683b68100baac782c6f3a66bb Reviewed-on: http://codereview.qt-project.org/5445 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Additional ListView section header placement optionsMartin Jones2011-09-222-1/+146
| | | | | | | | | | | | | | | | | | Add a section.labelPositioning property which can be a combination of: - ViewSection.InlineLabels - section labels are shown inline between the item delegates separating sections (default). - ViewSection.CurrentLabelAtStart - the current section label sticks to the start of the view as it is moved. - ViewSection.NextLabelAtEnd - the next section label (beyond all visible sections) sticks to the end of the view as it is moved. Task-number: QTBUG-12880 Change-Id: I4601828337412bd3a83769c9b8df3f6d4d7474b8 Reviewed-on: http://codereview.qt-project.org/5192 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bea Lam <bea.lam@nokia.com>
* fixed broken testMatthew Cattell2011-09-141-1/+1
| | | | Change-Id: I75655620bcd12b9a59eedde0bad489c4d31bbb2e
* fixed failing autotestMatthew Cattell2011-09-121-9/+4
| | | | | | | Change-Id: I3a21821ce870af75741afcb3219a552e2fc5a155 Reviewed-on: http://codereview.qt-project.org/4688 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Merge branch 'master' into refactorGunnar Sletta2011-09-122-46/+369
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/declarative/cppextensions/qwidgets/qwidgets.pro examples/declarative/minehunt/main.cpp examples/declarative/minehunt/minehunt.pro src/declarative/items/context2d/qsgcontext2d.cpp src/declarative/items/qsgflickable.cpp src/declarative/items/qsgtextedit.cpp src/declarative/items/qsgtextinput.cpp src/declarative/particles/qsgangleddirection.cpp src/declarative/particles/qsgcumulativedirection.cpp src/declarative/particles/qsgcumulativedirection_p.h src/declarative/particles/qsgfollowemitter.cpp src/declarative/particles/qsgmodelparticle.cpp src/declarative/particles/qsgparticlesystem.cpp src/qtquick1/util/qdeclarativeview.h tests/auto/declarative/examples/examples.pro tests/auto/declarative/qsgfocusscope/tst_qsgfocusscope.cpp Change-Id: Ib4be2a5e742dee1a399d73da97161736f77448e5
| * Fix min extents to correctly consider header sizeBea Lam2011-09-072-14/+33
| | | | | | | | | | | | | | | | | | | | | | | | Regression from c0fc795f which changed implementation to always position header at a negative position, and not just when visibleItems is empty. Task-number: QTBUG-21207 Change-Id: I9a888e7e30b00f70835734b1e0e75e57ed282602 Reviewed-on: http://codereview.qt.nokia.com/4159 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
| * Ensure that header/footer resize fixes position.Martin Jones2011-09-061-9/+31
| | | | | | | | | | | | | | | | | | | | If the header or footer is resized the view must ensure that it is still within bounds. Change-Id: I5f7aa61dc9ccec8dd16457d8d4e4966434e4b1e0 Reviewed-on: http://codereview.qt.nokia.com/4236 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bea Lam <bea.lam@nokia.com>
| * Batch view changes instead of applying them immediatelyBea Lam2011-09-011-23/+305
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there are multiple changes to be applied to a view before the next repaint, collate them using QDeclarativeChangeSet and apply the changes as a group on the next layout(). (Note that changes to the current index are applied in sequence as changes are received, since changing it out of order produces different results.) Previously, any itemsInserted(), itemsRemoved() and itemsMoved() changes were immediately applied and items were repositioned immediately. In this situation if the same indexes changed multiple times between repaints, this could lead to redundant changes and bugs arising from multiple changes to the same items. Functions that will execute differently depending on whether pending view changes have been applied (e.g. count(), currentIndex(), highlight()) now call applyPendingChanges() before proceeding to ensure they are executed on a view that is up to date. Also, itemsMoved() operations that moved item/s backwards will now properly move backwards instead of being adjusted to a forward movement (which was implemented recently with e2b5681b1adab83555c7307b05f508d796a1152b) since backwards movements can be implemented more easily with the batched changes which translates moves into insert/remove actions. Change-Id: If9b39755898e8d2ed7e4bc61288206d5f1d653fd Reviewed-on: http://codereview.qt.nokia.com/3697 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* | fixup tests to build with refactorMatthew Cattell2011-09-091-11/+8
| | | | | | | | | | | | Change-Id: Iab4adc9e19fab67402918bb737fff2fce6c292bd Reviewed-on: http://codereview.qt-project.org/4545 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* | Merge branch 'master' into refactorGunnar Sletta2011-08-312-1/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/v8 src/declarative/declarative.pro src/declarative/items/qsgcanvas.cpp src/declarative/items/qsgshadereffectsource_p.h src/declarative/items/qsgview.cpp src/declarative/particles/qsgcustomparticle.cpp src/imports/gestures/gestures.pro src/imports/particles/particles.pro src/plugins/qmltooling/qmldbg_inspector/qmldbg_inspector.pro src/qtquick1/qtquick1.pro tests/auto/declarative/examples/examples.pro tests/auto/declarative/qsglistview/qsglistview.pro tests/auto/qtquick1/qdeclarativeviewer/qdeclarativeviewer.pro Change-Id: I423344f83e1835116cad531b877fde6e68a8849a
| * Position in updatePolish instead of using single shot timerAlan Alpert2011-08-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Related to QTBUG-18919, but that was not reproduceable. Rewrites a fair bit of the autotest to no longer rely on repositionings happening immediately. Change-Id: I80683d6e03a5543fc838cdd55b2d53e49a8a68bd Reviewed-on: http://codereview.qt.nokia.com/3690 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
| * Remove V8 submodule from QtDeclarativeKent Hansen2011-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QtDeclarative should now link against the QtV8 library from qtbase. The patch files have been moved to qtbase as well. Applications that use the QtDeclarative private headers may need to add the following to their .pro file: QT += v8-private This ensures that <private/v8.h> is found, which is (indirectly) included by many QtDeclarative private headers. Task-number: QTBUG-20963 Change-Id: I31e973a6fcc0c416d3b258a61c26564cee3dcd4b Reviewed-on: http://codereview.qt.nokia.com/3093 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* | Merge branch 'master' into refactorGunnar Sletta2011-08-253-1/+201
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/declarative/items/qsgcanvas.cpp src/declarative/items/qsgitem.cpp src/declarative/items/qsgtextnode.cpp tests/auto/declarative/examples/examples.pro tools/qmlviewer/qmlviewer.pro Change-Id: Icbb0ef5dc79b658c62fd2b2c25a66c9bb3cbeb10
| * tests: acknowledge all known failures in declarative autotestsRohan McGovern2011-08-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change XFAILs or CONFIG+=insignificant_tests all known failures in declarative autotests, and links them to bug reports. Note that the changes were only applied to qpa builds, although it is possible some of these failures affect other platforms too. Task-number: QTBUG-20990 Task-number: QTBUG-21000 Task-number: QTBUG-21001 Task-number: QTBUG-21004 Task-number: QTBUG-21005 Task-number: QTBUG-21007 Task-number: QTBUG-21008 Task-number: QTBUG-21009 Task-number: QTBUG-21010 Task-number: QTBUG-21011 Task-number: QTBUG-21012 Task-number: QTBUG-21013 Task-number: QTBUG-21015 Task-number: QTBUG-21016 Task-number: QTBUG-21017 Change-Id: Ieb89aa38e48e9e5162d87483d6441749865f234d Reviewed-on: http://codereview.qt.nokia.com/3239 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Keith Isdale <keith.isdale@nokia.com>
| * Fix broken test (view did not have focus set)Bea Lam2011-08-081-0/+1
| | | | | | | | | | | | | | Change-Id: I25e68df061510deadd946d1a034c114dfd0b4f1c Reviewed-on: http://codereview.qt.nokia.com/2715 Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
| * Show header/footer if current index is set to first/last item or rowBea Lam2011-08-052-0/+35
| | | | | | | | | | | | | | | | Task-number: QTBUG-17853 Change-Id: I1d679cee31d6ee2a4bb2f2bf90f73eb12898189b Reviewed-on: http://codereview.qt.nokia.com/2664 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
| * Don't cache model data in VisualDataModel.Andrew den Exter2011-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VisualDataModel doesn't have any way to monitor the lifetime of objects cached other than relying on the source model to emit a changed signal. If the model doesn't do this or a pointer property is referenced after an item has been removed from the model then cache can return a stale pointer. This can be avoided by querying the model directly whenever a property is accessed. Task-number: QTBUG-18036 Change-Id: I7688174c2337cb5c0f77eb7d31a01f4aa958071b Reviewed-on: http://codereview.qt.nokia.com/2647 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
| * Fix ListView refill() where delegate size == 0Bea Lam2011-08-041-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When refilling, if a delegate item is positioned at the start of the buffer, it should only be removed if its height is > 0. Otherwise refill() will constantly remove it in removeNonVisibleItems() and add it again in the next frame in addVisibleItems(). Regression from aa99d4f5cb4f1f512d1db90536752b518dbea449 Task-number: QTBUG-20712 Change-Id: I21d25fde21e0b559a378c9e202ace58947417a4d Reviewed-on: http://codereview.qt.nokia.com/2541 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
| * Fix content position for key navigation with StrictlyEnforceRangeBea Lam2011-08-022-0/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a ListView had highlight ranges and StrictlyEnforceRange, but no highlight item, the content would not move to the correct position when incrementCurrentIndex() and decrementCurrentIndex() were invoked. trackedPositionChanged() shouldn't take the current section pos into account because this is already calculated by FxListItemSG::position() (this wasn't the case when the code in trackedPositionChanged() was originally written). Task-number: QTBUG-20287 Change-Id: I1624b5afd1efbe27630349143b7af2b486cfa260 Reviewed-on: http://codereview.qt.nokia.com/2429 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* | cleaned up declarative autotests to build with refactor branchMatthew Cattell2011-08-242-2/+2
|/ | | | | | | Change-Id: I782ebc6d3245fc05e193ecd9b8712aea11a31f9e Reviewed-on: http://codereview.qt.nokia.com/3412 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* Merge the QJSEngine and QJSValue development branch into master.Simon Hausmann2011-07-291-1/+0
| | | | | | | | | | | | This replaces the dependency to QtScript with two new builtin classes QJSValue and QJSEngine. This is still work in progress, development continues now in the master branch. Change-Id: I7f5487feb45c972f25a22b10cc81b9218b9805de Reviewed-on: http://codereview.qt.nokia.com/2299 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Fix auto-repeat key navigation for GridViewBea Lam2011-07-281-0/+19
| | | | | | | | | | | | | Shouldn't set moveReason=SetIndex in key navigation. ListView didn't do this in its keyPress implementation. Added extra tests for GridView and ListView. Task-number: QTBUG-20408 Change-Id: Iaf0f331d3ba4f037c5bbc0a41418dd656b5a3695 Reviewed-on: http://codereview.qt.nokia.com/2318 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* ListView doesn't show new 1st item currentItem is removed.Martin Jones2011-07-281-1/+8
| | | | | | | | | | | | | If the new 1st item becomes the currentItem after removal it was positioned incorrectly because the currentItem is positioned based on visibleIndex, which was updated after the currentItem was updated. Move visibleIndex update before currentItem update. Change-Id: Iaf92a41eefe7bce093e3000d17f5496dba144bcd Fixes: QTBUG-20575 Reviewed-on: http://codereview.qt.nokia.com/2316 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Fix moving of multiple items, and moving items backwardsBea Lam2011-07-281-0/+62
| | | | | | | | | | | | | | To fix backward movements, all backward movements are now flipped into forward movements (as is done in ListModel implemenation). Movement of multiple items wasn't working as views weren't removing the right indexes in these cases. Task-number: QTBUG-19208 Change-Id: I9866ddabc241c066bb77329a6761d500d79aaf61 Reviewed-on: http://codereview.qt.nokia.com/2262 Reviewed-by: Bea Lam <bea.lam@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Fix insertion of one item in ListView.Martin Jones2011-07-281-0/+8
| | | | | | | | | | Off-by-one meant that the item was not created by the ListView. Change-Id: If9658487a615e189c21c419e4d29e7e709e05cef Fixes: QTBUG-19675 Reviewed-on: http://codereview.qt.nokia.com/2251 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bea Lam <bea.lam@nokia.com>
* The views have many +/- 1 which are causing errors.Martin Jones2011-07-281-2/+0
| | | | | | | | | | | Remove them all. endPosition() etc. now refer to the position() + size() rather than position() + size() - 1. Change-Id: I6ddf98def39971ee2e2c3c2d0a1df97781290782 Fixes: QTBUG-20020 Reviewed-on: http://codereview.qt.nokia.com/2243 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Fix positioning of items after moveBea Lam2011-07-281-52/+137
| | | | | | | | | | | | | | | | | | | | | | If a move happened after a contentY change but before a refill, the position of the first visible item wasn't calculated correctly. If the first item from visibleItems was above the content start position and a move operation caused the items below it to move away, this first item was not being moved to the correct position (i.e. above the next available visible item) causing the following visible items to be positioned incorrectly on the next refill. ListView supported this previously but only adjusted positioning for items before the content position, instead of for all moved items. Fixed for both ListView and GridView and added more move-related tests. Task-number: QTBUG-20528 Change-Id: I2ba1a2f5e49f790e694c6e1486f649f10d09c256 Reviewed-on: http://codereview.qt.nokia.com/2261 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Don't move view content position item 0 is being replacedBea Lam2011-07-281-0/+31
| | | | | | | | | | | Usually if item 0 moves down, the next item becomes the first visible item and all content moves down. Don't do this if another item is moving up to take its place. Change-Id: If625cfc0eaa70fd1094c7bc0fdd29f5f56766a42 Reviewed-on: http://codereview.qt.nokia.com/2260 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add headerItem and footerItem properties to views.Martin Jones2011-07-261-0/+14
| | | | | | | | | Fixes: QTBUG-19684 Change-Id: Iea7d4a4f902cc45cb0cca8e1221fdb993f0bebd2 Reviewed-on: http://codereview.qt.nokia.com/2151 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Always position headers at a negative positionBea Lam2011-07-214-70/+246
| | | | | | | | | | | | | | | | | | | | | | | | Previously headers were either positioned at 0 if there were no items in the view, or at (0 - headerSize) if items were present. With this fix they are always positioned at (0 - headerSize) to be consistent. Due to the change, setPosition(-headerSize()) is now called from componentCompleted() to ensure the header is visible. This change also fixes GridView's header and footer positioning in TopToBottom + RightToLeft mode. Also added extra tests for header and footer positioning and fixed incorrect test value in tst_QSGGridView::positionViewAtIndex() (was 460 instead of 430 because previously rowPosAt() always added the header size, so if positionViewAtIndex() jumped past all visible items and caused them to be released, the new items started at +headerSize() instead of 0). Change-Id: I1015bed457d4ae964a7fb13702e2dfc470a168a9 Reviewed-on: http://codereview.qt.nokia.com/1618 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Extract all QtQuick 1 elements into a separate library/plugin.Martin Jones2011-07-122-7/+7
| | | | | | Change-Id: I41a280de2739ee08202f4be2519e5012870090f2 Reviewed-on: http://codereview.qt.nokia.com/1391 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Update licenseheader text in source files for qtdeclarative Qt moduleJyri Tahtela2011-07-083-51/+51
| | | | | | | | Replace old license header with correct one. Change-Id: I492ddaaa0227b2c8faf11bdcd6e12e7231a54a10 Reviewed-on: http://codereview.qt.nokia.com/1312 Reviewed-by: Jyri Tahtela <jyri.tahtela@nokia.com>