From 2c4c10942314ab76fa8f06f690e44adc6b7f2199 Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Mon, 18 Jul 2011 14:14:43 +1000 Subject: [PATCH] Fix unstable GridView test Change-Id: I1e1f1afe38cced3c85b3e20d37e9859b8304e69c Reviewed-on: http://codereview.qt.nokia.com/1729 Reviewed-by: Bea Lam Reviewed-by: Qt Sanity Bot --- tests/auto/declarative/qsggridview/tst_qsggridview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/declarative/qsggridview/tst_qsggridview.cpp b/tests/auto/declarative/qsggridview/tst_qsggridview.cpp index c97a42b..3929c71 100644 --- a/tests/auto/declarative/qsggridview/tst_qsggridview.cpp +++ b/tests/auto/declarative/qsggridview/tst_qsggridview.cpp @@ -666,6 +666,7 @@ void tst_QSGGridView::currentIndex() QSGView *canvas = new QSGView(0); canvas->setFixedSize(240,320); + canvas->show(); QDeclarativeContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); @@ -726,6 +727,7 @@ void tst_QSGGridView::currentIndex() gridview->moveCurrentIndexLeft(); QCOMPARE(gridview->currentIndex(), model.count()-1); + qApp->processEvents(); QTRY_COMPARE(gridview->contentY(), 880.0); gridview->moveCurrentIndexRight(); @@ -734,7 +736,6 @@ void tst_QSGGridView::currentIndex() QTRY_COMPARE(gridview->contentY(), 0.0); // Test keys - canvas->show(); qApp->setActiveWindow(canvas); #ifdef Q_WS_X11 // to be safe and avoid failing setFocus with window managers -- 2.7.4