summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtreewidget/tst_qtreewidget.cpp
diff options
context:
space:
mode:
authorLeonardo Sobral Cunha <leo.cunha@nokia.com>2009-08-06 13:13:42 (GMT)
committerLeonardo Sobral Cunha <leo.cunha@nokia.com>2009-08-06 13:15:47 (GMT)
commit986ac2b13eb60e10496ecf63dca1ed0de0990da9 (patch)
treeb028a4e12c1c9ea052b8b8a06bd236829ab22fd9 /tests/auto/qtreewidget/tst_qtreewidget.cpp
parentd738bfe0f06448d9a6bc2ee1a32225c076c67334 (diff)
downloadQt-986ac2b13eb60e10496ecf63dca1ed0de0990da9.zip
Qt-986ac2b13eb60e10496ecf63dca1ed0de0990da9.tar.gz
Qt-986ac2b13eb60e10496ecf63dca1ed0de0990da9.tar.bz2
Fixes autotests in QTreeWidget: setHeaderItem & defaultRowSizes
defaultRowSizes was broken on oxygen style because of missing icons. Reviewed-by: paul
Diffstat (limited to 'tests/auto/qtreewidget/tst_qtreewidget.cpp')
-rw-r--r--tests/auto/qtreewidget/tst_qtreewidget.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/auto/qtreewidget/tst_qtreewidget.cpp b/tests/auto/qtreewidget/tst_qtreewidget.cpp
index 7d79d56..fd0fdb1 100644
--- a/tests/auto/qtreewidget/tst_qtreewidget.cpp
+++ b/tests/auto/qtreewidget/tst_qtreewidget.cpp
@@ -238,6 +238,9 @@ void tst_QTreeWidget::initTestCase()
testWidget = new CustomTreeWidget();
testWidget->show();
+#ifdef Q_WS_X11
+ qt_x11_wait_for_window_manager(testWidget);
+#endif
}
void tst_QTreeWidget::cleanupTestCase()
@@ -2017,7 +2020,7 @@ void tst_QTreeWidget::setHeaderItem()
headerItem->setText(0, "0");
headerItem->setText(1, "1");
testWidget->setHeaderItem(headerItem);
- qApp->processEvents();
+ QTest::qWait(100);
QCOMPARE(testWidget->headerItem(), headerItem);
QCOMPARE(headerItem->treeWidget(), static_cast<QTreeWidget *>(testWidget));
@@ -2762,16 +2765,18 @@ void tst_QTreeWidget::defaultRowSizes()
for (int j=0; j<tw->columnCount() - 1; ++j) {
it->setText(j, "This is a test");
}
+ QPixmap icon = tw->style()->standardPixmap((QStyle::StandardPixmap)(i + QStyle::SP_TitleBarMenuButton));
+ if (icon.isNull())
+ QSKIP("No pixmap found on current style, skipping this test.", SkipSingle);
it->setIcon(tw->columnCount() - 1,
- tw->style()->standardPixmap((QStyle::StandardPixmap)(i + QStyle::SP_TitleBarMenuButton)).
- scaled(tw->iconSize()));
+ icon.scaled(tw->iconSize()));
}
tw->resize(100,100);
tw->show();
QApplication::processEvents();
QRect visualRect = tw->visualItemRect(tw->topLevelItem(0));
- QVERIFY(visualRect.height() >=50);
+ QVERIFY(visualRect.height() >= 50);
}
void tst_QTreeWidget::task191552_rtl()