From b1310cb8fcc4b48750f82502a7140f2ebb8a44c7 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 6 Oct 2009 06:55:34 +0200 Subject: fix tst_QAbstractItemView::task250754_fontChange for Windows CE We need to give Windows mobile some more time to handle all internal timer events. Otherwise QTreeView::updateScrollBars doesn't get called. Reviewed-by: mauricek --- .../qabstractitemview/tst_qabstractitemview.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp index d3af076..1a9a5f9 100644 --- a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp @@ -181,6 +181,10 @@ public: virtual ~tst_QAbstractItemView(); void basic_tests(TestView *view); +public slots: + void initTestCase(); + void cleanupTestCase(); + private slots: void getSetCheck(); void emptyModels_data(); @@ -312,6 +316,17 @@ tst_QAbstractItemView::~tst_QAbstractItemView() { } +void tst_QAbstractItemView::initTestCase() +{ +#ifdef Q_OS_WINCE_WM + qApp->setAutoMaximizeThreshold(-1); +#endif +} + +void tst_QAbstractItemView::cleanupTestCase() +{ +} + void tst_QAbstractItemView::emptyModels_data() { QTest::addColumn("viewType"); @@ -1186,15 +1201,12 @@ void tst_QAbstractItemView::task250754_fontChange() QFont font = tree.font(); font.setPointSize(5); tree.setFont(font); - QTest::qWait(30); - - QVERIFY(!tree.verticalScrollBar()->isVisible()); + QTRY_VERIFY(!tree.verticalScrollBar()->isVisible()); font.setPointSize(45); tree.setFont(font); - QTest::qWait(30); //now with the huge items, the scrollbar must be visible - QVERIFY(tree.verticalScrollBar()->isVisible()); + QTRY_VERIFY(tree.verticalScrollBar()->isVisible()); qApp->setStyleSheet(app_css); } -- cgit v0.12