Avoid crash in QColumnView autotest.

When combined with http://codereview.qt-project.org/8644, the test
crashes.  This appears to be due to a column of the view being deleted
in response to calling setCurrentIndex(), as documented in QTBUG-22707.

This commit must be merged at the same time as
http://codereview.qt-project.org/8644.

Task-number: QTBUG-22707
Change-Id: I075be7df5d9196e37e2286e61d317086a76a167d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
Jason McDonald 2011-11-14 14:10:59 +10:00 committed by Qt by Nokia
parent 1916460015
commit c1c51dd4f7

View File

@ -976,6 +976,11 @@ void tst_QColumnView::parentCurrentIndex()
QTest::qWait(ANIMATION_DELAY);
QTRY_COMPARE(view.createdColumns[0]->currentIndex(), first);
QTRY_COMPARE(view.createdColumns[1]->currentIndex(), second);
// The next two lines should be removed when QTBUG-22707 is resolved.
QEXPECT_FAIL("", "QTBUG-22707", Abort);
QVERIFY(view.createdColumns[2]);
QTRY_COMPARE(view.createdColumns[2]->currentIndex(), third);
}