summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/itemviews
diff options
context:
space:
mode:
authorFabian Bumberger <fbumberger@rim.com>2014-04-02 21:09:16 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-04 19:32:21 +0200
commitbf05df9a231ef1e754fe73d9c3aff6f92edbe925 (patch)
treecd9c3e950fc4ef1f7213abde7e41ab6a8b21a734 /tests/auto/widgets/itemviews
parentf3eb59e3fc934f28d64f6946e86bd0a0dfbfdd4c (diff)
BlackBerry: Fix QListView autotest
Change-Id: Id4967911d82cff86214665cc9ca3dbbefa69da11 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Diffstat (limited to 'tests/auto/widgets/itemviews')
-rw-r--r--tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp31
1 files changed, 22 insertions, 9 deletions
diff --git a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
index 9f5484983d..78a3ad021b 100644
--- a/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
+++ b/tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp
@@ -1468,15 +1468,16 @@ void tst_QListView::wordWrap()
model.setStringList(list);
lv.setModel(&model);
lv.setWordWrap(true);
- lv.setFixedSize(150, 150);
-#ifdef Q_OS_BLACKBERRY
- // BB standard font size is too big, triggering
- // a horizontal scrollbar even when word-wrapping
- // is enabled
+ lv.setFixedSize(400, 150);
+
+#if defined Q_OS_BLACKBERRY
QFont font = lv.font();
- font.setPointSize(5);
+ // On BB10 the root window is stretched over the whole screen
+ // This makes sure that the text will be long enough to produce
+ // a vertical scrollbar
+ font.setPixelSize(50);
lv.setFont(font);
-#endif // Q_OS_BLACKBERRY
+#endif
lv.showNormal();
QApplication::processEvents();
@@ -2019,7 +2020,7 @@ void tst_QListView::taskQTBUG_9455_wrongScrollbarRanges()
w.setViewMode(QListView::IconMode);
w.resize(116, 132);
w.setMovement(QListView::Static);
- const int spacing = 40;
+ const int spacing = 200;
w.setSpacing(spacing);
w.showNormal();
QVERIFY(QTest::qWaitForWindowExposed(&w));
@@ -2113,6 +2114,12 @@ void tst_QListView::taskQTBUG_21115_scrollToAndHiddenItems_data()
void tst_QListView::taskQTBUG_21115_scrollToAndHiddenItems()
{
+#if defined Q_OS_BLACKBERRY
+ // On BB10 we need to create a root window which is automatically stretched
+ // over the whole screen
+ QWindow rootWindow;
+ rootWindow.show();
+#endif
QFETCH(int, flow);
QListView lv;
@@ -2309,6 +2316,12 @@ void tst_QListView::spacing()
void tst_QListView::testScrollToWithHidden()
{
+#if defined Q_OS_BLACKBERRY
+ // On BB10 we need to create a root window which is automatically stretched
+ // over the whole screen
+ QWindow rootWindow;
+ rootWindow.show();
+#endif
QListView lv;
QStringListModel model;
@@ -2321,7 +2334,7 @@ void tst_QListView::testScrollToWithHidden()
lv.setRowHidden(1, true);
lv.setSpacing(5);
- lv.show();
+ lv.showNormal();
QTest::qWaitForWindowExposed(&lv);
QCOMPARE(lv.verticalScrollBar()->value(), 0);