Skip to content

Commit

Permalink
Use QGuiApplication, not QApplication, in tests
Browse files Browse the repository at this point in the history
Change-Id: I7802293e6cafb90686c103972bc036cf74184714
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
  • Loading branch information
Damian Jansen authored and Qt by Nokia committed Jan 13, 2012
1 parent 2671fa8 commit 7e973ea
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 92 deletions.
6 changes: 3 additions & 3 deletions tests/auto/declarative/qjsengine/tst_qjsengine.cpp
Expand Up @@ -971,7 +971,7 @@ void tst_QJSEngine::newQObject_ownership()
}
collectGarbage_helper(eng);
if (ptr)
QApplication::sendPostedEvents(ptr, QEvent::DeferredDelete);
QGuiApplication::sendPostedEvents(ptr, QEvent::DeferredDelete);
QVERIFY(ptr == 0);
}
{
Expand Down Expand Up @@ -1002,7 +1002,7 @@ void tst_QJSEngine::newQObject_ownership()
collectGarbage_helper(eng);
// no parent, so it should be like ScriptOwnership
if (ptr)
QApplication::sendPostedEvents(ptr, QEvent::DeferredDelete);
QGuiApplication::sendPostedEvents(ptr, QEvent::DeferredDelete);
QVERIFY(ptr == 0);
}
{
Expand Down Expand Up @@ -3106,7 +3106,7 @@ void tst_QJSEngine::collectGarbage()
(void)eng.newQObject(ptr);
collectGarbage_helper(eng);
if (ptr)
QApplication::sendPostedEvents(ptr, QEvent::DeferredDelete);
QGuiApplication::sendPostedEvents(ptr, QEvent::DeferredDelete);
QVERIFY(ptr == 0);
}

Expand Down
6 changes: 3 additions & 3 deletions tests/auto/qtquick2/qquickflickable/tst_qquickflickable.cpp
Expand Up @@ -359,7 +359,7 @@ void tst_qquickflickable::wheel()
{
QWheelEvent event(QPoint(200, 200), -120, Qt::NoButton, Qt::NoModifier, Qt::Vertical);
event.setAccepted(false);
QApplication::sendEvent(canvas, &event);
QGuiApplication::sendEvent(canvas, &event);
}

QTRY_VERIFY(flick->contentY() > 0);
Expand All @@ -371,7 +371,7 @@ void tst_qquickflickable::wheel()
{
QWheelEvent event(QPoint(200, 200), -120, Qt::NoButton, Qt::NoModifier, Qt::Horizontal);
event.setAccepted(false);
QApplication::sendEvent(canvas, &event);
QGuiApplication::sendEvent(canvas, &event);
}

QTRY_VERIFY(flick->contentX() > 0);
Expand Down Expand Up @@ -610,7 +610,7 @@ void tst_qquickflickable::flick(QQuickView *canvas, const QPoint &from, const QP

for (int i = 0; i < pointCount; ++i) {
QMouseEvent mv(QEvent::MouseMove, from + (i+1)*diff/pointCount, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
QApplication::sendEvent(canvas, &mv);
QGuiApplication::sendEvent(canvas, &mv);
QTest::qWait(duration/pointCount);
QCoreApplication::processEvents();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/auto/qtquick2/qquickgridview/tst_qquickgridview.cpp
Expand Up @@ -3796,7 +3796,7 @@ void tst_QQuickGridView::flick(QQuickView *canvas, const QPoint &from, const QPo

for (int i = 0; i < pointCount; ++i) {
QMouseEvent mv(QEvent::MouseMove, from + (i+1)*diff/pointCount, Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
QApplication::sendEvent(canvas, &mv);
QGuiApplication::sendEvent(canvas, &mv);
QTest::qWait(duration/pointCount);
QCoreApplication::processEvents();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/auto/qtquick2/qquickitem/tst_qquickitem.cpp
Expand Up @@ -899,7 +899,7 @@ void tst_qquickitem::wheelEvent()

QWheelEvent event(QPoint(100, 50), -120, Qt::NoButton, Qt::NoModifier, Qt::Vertical);
event.setAccepted(false);
QApplication::sendEvent(canvas, &event);
QGuiApplication::sendEvent(canvas, &event);

if (shouldReceiveWheelEvents) {
QVERIFY(event.isAccepted());
Expand Down Expand Up @@ -963,7 +963,7 @@ void tst_qquickitem::hoverEvent_data()
static void sendMouseMove(QObject *object, const QPoint &position)
{
QMouseEvent moveEvent(QEvent::MouseMove, position, Qt::NoButton, Qt::NoButton, 0);
QApplication::sendEvent(object, &moveEvent);
QGuiApplication::sendEvent(object, &moveEvent);
}

void tst_qquickitem::hoverEvent()
Expand Down

0 comments on commit 7e973ea

Please sign in to comment.