diff options
Diffstat (limited to 'tests/auto/qcolumnview/tst_qcolumnview.cpp')
-rw-r--r-- | tests/auto/qcolumnview/tst_qcolumnview.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/tests/auto/qcolumnview/tst_qcolumnview.cpp b/tests/auto/qcolumnview/tst_qcolumnview.cpp index 1da8c5d..d4caede 100644 --- a/tests/auto/qcolumnview/tst_qcolumnview.cpp +++ b/tests/auto/qcolumnview/tst_qcolumnview.cpp @@ -398,9 +398,10 @@ void tst_QColumnView::scrollTo() QFETCH(bool, giveFocus); if (reverse) qApp->setLayoutDirection(Qt::RightToLeft); - ColumnView view; + QWidget topLevel; + ColumnView view(&topLevel); view.resize(200, 200); - view.show(); + topLevel.show(); view.scrollTo(QModelIndex(), QAbstractItemView::EnsureVisible); QCOMPARE(view.HorizontalOffset(), 0); @@ -428,6 +429,8 @@ void tst_QColumnView::scrollTo() view.setFocus(Qt::OtherFocusReason); else view.clearFocus(); + + qApp->processEvents(); QTRY_COMPARE(view.hasFocus(), giveFocus); // scroll to the right int level = 0; @@ -718,13 +721,14 @@ void tst_QColumnView::moveGrip() QFETCH(bool, reverse); if (reverse) qApp->setLayoutDirection(Qt::RightToLeft); - ColumnView view; + QWidget topLevel; + ColumnView view(&topLevel); TreeModel model; view.setModel(&model); QModelIndex home = model.thirdLevel(); view.setCurrentIndex(home); view.resize(640, 200); - view.show(); + topLevel.show(); QTest::qWait(ANIMATION_DELAY); int columnNum = view.createdColumns.count() - 2; @@ -741,9 +745,9 @@ void tst_QColumnView::moveGrip() QAbstractItemView *column = qobject_cast<QAbstractItemView *>(grip->parent()); int oldX = column->width(); - QCOMPARE(view.columnWidths()[columnNum], oldX); + QCOMPARE(view.columnWidths().value(columnNum), oldX); grip->moveGrip(10); - QCOMPARE(view.columnWidths()[columnNum], (oldX + (reverse ? -10 : 10))); + QCOMPARE(view.columnWidths().value(columnNum), (oldX + (reverse ? -10 : 10))); } void tst_QColumnView::doubleClick() @@ -889,12 +893,13 @@ void tst_QColumnView::rowDelegate() void tst_QColumnView::resize() { - ColumnView view; + QWidget topLevel; + ColumnView view(&topLevel); QDirModel model; view.setModel(&model); view.resize(200, 200); - view.show(); + topLevel.show(); QModelIndex home = model.index(QDir::homePath()).parent(); view.setCurrentIndex(home); QTest::qWait(ANIMATION_DELAY); |