diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-02-24 07:48:20 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-02-24 07:48:20 (GMT) |
commit | d3a0bd57c7c3cecdeeb4ad9af3cf6bb4ee39964b (patch) | |
tree | ef5fd503f73819932ce1a240bd5ccfd287873edb /tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp | |
parent | 40256d682e1a552c9566a744a66cc6fe008b578b (diff) | |
download | Qt-d3a0bd57c7c3cecdeeb4ad9af3cf6bb4ee39964b.zip Qt-d3a0bd57c7c3cecdeeb4ad9af3cf6bb4ee39964b.tar.gz Qt-d3a0bd57c7c3cecdeeb4ad9af3cf6bb4ee39964b.tar.bz2 |
Don't crash if the currentIndex is set while creating a delegate.
Task-number: QTBUG-8456
Diffstat (limited to 'tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp')
-rw-r--r-- | tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp index 9a7f517..9c7468d 100644 --- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp +++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp @@ -66,6 +66,7 @@ private slots: void defaultValues(); void properties(); void positionViewAtIndex(); + void QTBUG_8456(); private: QDeclarativeView *createView(); @@ -657,6 +658,7 @@ void tst_QDeclarativeGridView::currentIndex() gridview->setFlow(QDeclarativeGridView::TopToBottom); + QEXPECT_FAIL("", "QTBUG-8475", Abort); QTest::keyClick(canvas, Qt::Key_Right); QCOMPARE(gridview->currentIndex(), 5); @@ -882,6 +884,19 @@ void tst_QDeclarativeGridView::positionViewAtIndex() delete canvas; } +void tst_QDeclarativeGridView::QTBUG_8456() +{ + QDeclarativeView *canvas = createView(); + + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/setindex.qml")); + qApp->processEvents(); + + QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid"); + QVERIFY(gridview != 0); + + QCOMPARE(gridview->currentIndex(), 0); +} + QDeclarativeView *tst_QDeclarativeGridView::createView() { QDeclarativeView *canvas = new QDeclarativeView(0); |