aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qsggridview/tst_qsggridview.cpp
diff options
context:
space:
mode:
authorMatthew Cattell <matthew.cattell@nokia.com>2011-09-09 14:50:48 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-09-09 15:02:36 +0200
commit4153ee1b391438d25d0860c5174039f8ad7b8fc5 (patch)
tree2ec32b5e5494c8ae63d492cb0d95c1c0c5b21643 /tests/auto/declarative/qsggridview/tst_qsggridview.cpp
parentd93cc35d4ff1643ac9c41e8b3cbcc06bbac1894f (diff)
fixup tests to build with refactor
Change-Id: Iab4adc9e19fab67402918bb737fff2fce6c292bd Reviewed-on: http://codereview.qt-project.org/4545 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qsggridview/tst_qsggridview.cpp')
-rw-r--r--tests/auto/declarative/qsggridview/tst_qsggridview.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/tests/auto/declarative/qsggridview/tst_qsggridview.cpp b/tests/auto/declarative/qsggridview/tst_qsggridview.cpp
index 49c3080a1c..5933ee1103 100644
--- a/tests/auto/declarative/qsggridview/tst_qsggridview.cpp
+++ b/tests/auto/declarative/qsggridview/tst_qsggridview.cpp
@@ -40,7 +40,7 @@
****************************************************************************/
#include <QtTest/QtTest>
-#include <QtGui/qstringlistmodel.h>
+#include <QtWidgets/qstringlistmodel.h>
#include <QtDeclarative/qsgview.h>
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
@@ -141,9 +141,6 @@ void tst_qsggridview_move(int from, int to, int n, T *items)
void tst_QSGGridView::initTestCase()
{
- QSGView canvas;
- if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
- QSKIP("QSGGridView needs OpenGL 2.0", SkipAll);
}
void tst_QSGGridView::cleanupTestCase()
@@ -810,7 +807,7 @@ void tst_QSGGridView::currentIndex()
model.addItem("Item" + QString::number(i), QString::number(i));
QSGView *canvas = new QSGView(0);
- canvas->setFixedSize(240,320);
+ canvas->setGeometry(0,0,240,320);
canvas->show();
QDeclarativeContext *ctxt = canvas->rootContext();
@@ -901,12 +898,12 @@ void tst_QSGGridView::currentIndex()
// Test keys
- qApp->setActiveWindow(canvas);
+ canvas->requestActivateWindow();
#ifdef Q_WS_X11
// to be safe and avoid failing setFocus with window managers
qt_x11_wait_for_window_manager(canvas);
#endif
- QTRY_VERIFY(canvas->hasFocus());
+ QTRY_VERIFY(canvas->windowState() == Qt::WindowActive);
qApp->processEvents();
gridview->setCurrentIndex(0);
@@ -938,12 +935,12 @@ void tst_QSGGridView::currentIndex()
gridview->setFlow(QSGGridView::TopToBottom);
- qApp->setActiveWindow(canvas);
+ canvas->requestActivateWindow();
#ifdef Q_WS_X11
// to be safe and avoid failing setFocus with window managers
qt_x11_wait_for_window_manager(canvas);
#endif
- QTRY_VERIFY(canvas->hasFocus());
+ QTRY_VERIFY((canvas->windowState() == Qt::WindowActive));
qApp->processEvents();
QTest::keyClick(canvas, Qt::Key_Right);
@@ -1005,12 +1002,12 @@ void tst_QSGGridView::currentIndex()
gridview->setFlow(QSGGridView::LeftToRight);
gridview->setLayoutDirection(Qt::RightToLeft);
- qApp->setActiveWindow(canvas);
+ canvas->requestActivateWindow();
#ifdef Q_WS_X11
// to be safe and avoid failing setFocus with window managers
qt_x11_wait_for_window_manager(canvas);
#endif
- QTRY_VERIFY(canvas->hasFocus());
+ QTRY_VERIFY(canvas->windowState() == Qt::WindowActive);
qApp->processEvents();
gridview->setCurrentIndex(35);
@@ -1061,7 +1058,7 @@ void tst_QSGGridView::noCurrentIndex()
model.addItem("Item" + QString::number(i), QString::number(i));
QSGView *canvas = new QSGView(0);
- canvas->setFixedSize(240,320);
+ canvas->setGeometry(0,0,240,320);
QDeclarativeContext *ctxt = canvas->rootContext();
ctxt->setContextProperty("testModel", &model);
@@ -2353,7 +2350,7 @@ void tst_QSGGridView::onAdd()
const int delegateHeight = 100;
TestModel model;
QSGView *canvas = createView();
- canvas->setFixedSize(5 * delegateWidth, 5 * delegateHeight); // just ensure all items fit
+ canvas->setGeometry(0,0,5 * delegateWidth, 5 * delegateHeight); // just ensure all items fit
// these initial items should not trigger GridView.onAdd
for (int i=0; i<initialItemCount; i++)
@@ -2497,7 +2494,7 @@ void tst_QSGGridView::testQtQuick11Attributes_data()
QSGView *tst_QSGGridView::createView()
{
QSGView *canvas = new QSGView(0);
- canvas->setFixedSize(240,320);
+ canvas->setGeometry(0,0,240,320);
return canvas;
}