summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@nokia.com>2010-07-22 13:07:21 (GMT)
committerHarald Fernengel <harald.fernengel@nokia.com>2010-11-02 14:23:35 (GMT)
commit1b103adc6cb443428c5ca7833cafa6ab9da0fa37 (patch)
tree0da1a42fb98f9ef8f81fd965258a20b0713a0c9a
parent85467f12bae6d748ba5643f4eb518bd63cd80352 (diff)
downloadQt-1b103adc6cb443428c5ca7833cafa6ab9da0fa37.zip
Qt-1b103adc6cb443428c5ca7833cafa6ab9da0fa37.tar.gz
Qt-1b103adc6cb443428c5ca7833cafa6ab9da0fa37.tar.bz2
Fixed QColumnView autotests to use a dummy top level widget.
This is needed for all platforms which are autoMaximizing top level widgets
-rw-r--r--tests/auto/qcolumnview/tst_qcolumnview.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/auto/qcolumnview/tst_qcolumnview.cpp b/tests/auto/qcolumnview/tst_qcolumnview.cpp
index 1da8c5d..fbfdf87 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);
@@ -718,13 +719,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 +743,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 +891,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);