diff options
author | Fabian Bumberger <fbumberger@rim.com> | 2014-04-03 12:17:35 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-04 10:39:21 +0200 |
commit | 5947fda8fd45b424461d0b9fa8334d3a6185df72 (patch) | |
tree | a9f341fc7f94dbbadbd15ac208ee4483d07ebd96 /tests | |
parent | d743443c04a7b83d2773bf2d8e3820626ef2d94e (diff) |
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 <sahumada@blackberry.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
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<QWidget *>(&view), QApplication::activeWindow()); |