From 5947fda8fd45b424461d0b9fa8334d3a6185df72 Mon Sep 17 00:00:00 2001 From: Fabian Bumberger Date: Thu, 3 Apr 2014 12:17:35 +0200 Subject: QNX: Fix QAbstractItemView autotest One problem was that tests expect the top-level window to have a certain size, which is not possible on BlackBerry. Another problem was that certain elements have a dpi dependent size which the task250754_fontChange test did not consider. Change-Id: I465ebe234a74d6150cdcbb7fc7e458a62155e0d0 Reviewed-by: Sergio Ahumada --- .../itemviews/qabstractitemview/tst_qabstractitemview.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp index 1005bf6b3c..83c4582645 100644 --- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp @@ -1246,7 +1246,7 @@ void tst_QAbstractItemView::task250754_fontChange() vLayout->addWidget(&tree); QStandardItemModel *m = new QStandardItemModel(this); - for (int i=0; i<5; ++i) { + for (int i=0; i<20; ++i) { QStandardItem *item = new QStandardItem(QString("Item number %1").arg(i)); for (int j=0; j<5; ++j) { QStandardItem *child = new QStandardItem(QString("Child Item number %1").arg(j)); @@ -1256,10 +1256,11 @@ void tst_QAbstractItemView::task250754_fontChange() } tree.setModel(m); - w.resize(160, 240); // Minimum width for windows with frame on Windows 8 + tree.setHeaderHidden(true); // The header is (in certain styles) dpi dependent + w.resize(160, 300); // Minimum width for windows with frame on Windows 8 centerOnScreen(&w); moveCursorAway(&w); - w.show(); + w.showNormal(); QVERIFY(QTest::qWaitForWindowExposed(&w)); QFont font = tree.font(); font.setPixelSize(10); @@ -1579,11 +1580,16 @@ void tst_QAbstractItemView::testDelegateDestroyEditor() void tst_QAbstractItemView::testClickedSignal() { +#if defined Q_OS_BLACKBERRY + QWidget rootWindow; + rootWindow.show(); + QTest::qWaitForWindowExposed(&rootWindow); +#endif QTableWidget view(5, 5); centerOnScreen(&view); moveCursorAway(&view); - view.show(); + view.showNormal(); QApplication::setActiveWindow(&view); QVERIFY(QTest::qWaitForWindowActive(&view)); QCOMPARE(static_cast(&view), QApplication::activeWindow()); -- cgit v1.2.3