aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qtquick2/qquickgridview
Commit message (Collapse)AuthorAgeFilesLines
* Separate out some of the common test codeBea Lam2012-02-072-282/+48
| | | | | | | | | Moves findItem, findItems() etc. into shared/visualtestutil.h and moves duplicate list model test classes and other common view-specific code into shared/viewtestutil.h. Change-Id: Ia79bc4df1ab7fb618597755c0288a2e8f5054faf Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Must update columns when GridView geometry changesBea Lam2012-02-022-2/+63
| | | | | | | | | | 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-012-19/+43
| | | | | | | | | | | | | 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-33/+31
| | | | | | | | | | | | | 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-0/+20
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Wait for polish at the start of addOrRemoveBeforeVisibleAlan Alpert2012-01-161-0/+1
| | | | | Change-Id: I1cf13af7e9b854cee7754b31643438eab3085084 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* Handle views with negative width/heightMartin Jones2012-01-161-0/+35
| | | | | | | | | 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>
* Add tests for item polish bug on MacBea Lam2012-01-131-1/+3
| | | | | | | | | | | | | On Mac OS X, if a QQuickItem triggers a polish request from Component.onCompleted, its updatePolish() function is not called. The tst_qquickitem::polishOnCompleted() test demonstrates this. If a running animation is added to the polishOnCompleted.qml in the test, the test will pass. Task-number: QTBUG-23481, QTBUG-23480, QTBUG-21590 Change-Id: I172b12e784aa458c43c23e0ee43f034f0bd332ee Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Use QGuiApplication, not QApplication, in testsDamian Jansen2012-01-131-1/+1
| | | | | Change-Id: I7802293e6cafb90686c103972bc036cf74184714 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Fix positioning issues and change content y repositioning behaviourBea Lam2012-01-091-4/+193
| | | | | | | | | | | | | | | | | | | | | | | 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-7/+27
| | | | | | | Task-number: QTBUG-21592 Change-Id: I3169e789da701ce261250421239584abd7f29b57 Reviewed-by: Bea Lam <bea.lam@nokia.com>
* QEXPECT_FAIL() a failing autotestAaron Kennedy2012-01-051-0/+3
| | | | | | Task-number: QTBUG-23480 Change-Id: Ia1e59b43d66d25a6194c4d9c778019ee679c4383 Reviewed-by: Aaron Kennedy <aaron.kennedy@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>
* Fix test failures with shadow builds.Andrew den Exter2012-01-031-3/+3
| | | | | | | | | | QFINDTESTDATA uses __FILE__ to determine the source directory, which means it finds the wrong source directory when the macro is used from a shared base class. Define the correct source directory in a pri file and include that wherever QDeclarativeDataTest is used. Change-Id: If3ef435f4bb3049733f49402338303c8b440f1fa Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* QDeclarative tests: Introduce base class for data tests.Friedemann Kleint2011-12-212-61/+50
| | | | | | | | | | | | | | | | | In tests/auto/shared/util.* replace macros/find functions by a base class QDeclarativeDataTest with accessors for the data directory helper functions to create URLs from it. The class relies on QFINDTESTDATA, which is the standard way of locating test data. Using the class should reduce the number of calls to QFileInfo.exists(), etc significantly. In addition, provide utility functions for messages. Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Change-Id: Id2beacb157922ee9412f9e45cf9695cec1f8379a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Ensure items in ListView and GridViews viewport are visible.Andrew den Exter2011-12-202-0/+236
| | | | | | | | | 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>
* Fix compilation due to header changesSergio Ahumada2011-12-171-1/+1
| | | | | | | | | | - Fix QtGui/QApplication => QtWidgets/QApplication - Fix QtGui/QStylePlugin => QtWidgets/QStylePlugin - Fix QtWidgets/QStringListModel => QtCore/QStringListModel - Fix QtWidgets/qstringlistmodel.h => QtCore/qstringlistmodel.h Change-Id: I8df28f032f039107b900c81be27d2d6e5e69e06e Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Fix tests broken by a change in the signals emitted by AbstractItemModelAndrew den Exter2011-12-091-21/+24
| | | | | | | | | | | QAbstractItemModel used to emit both layoutChanged() and rowsMoved() when items were moved. The VisualDataModel test expected both signals but was only interested in the move, and the grid view test had a bug in its test model that didn't was hidden by the change signal being emitted and causing bindings to be reevaluated. Change-Id: Id5d1b5768717f4a82f6eb4710ff3b4429529193e Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Remove insignificant_test from GridView tests.Martin Jones2011-12-071-1/+0
| | | | | | | This has not failed in a long time. Change-Id: I58ca0a6941662040a941ae7264aa9e4f9e3cf359 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Add tests for snapOneItem/snapOneRow snapModeMartin Jones2011-12-062-0/+163
| | | | | | Change-Id: Ia7e8fe6a7da48d8f67914d90377c6fad32ecb415 Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Say hello to QtQuick moduleKent Hansen2011-12-0224-0/+4547
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>