}
void tst_QQuickPinchArea::pinchProperties()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("pinchproperties.qml"));
window->show();
- window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickPinchArea *pinchArea = window->rootObject()->findChild<QQuickPinchArea*>("pincharea");
QCOMPARE(rotMinSpy.count(),1);
QCOMPARE(rotMaxSpy.count(),1);
-
- delete window;
}
QTouchEvent::TouchPoint makeTouchPoint(int id, QPoint p, QQuickView *v, QQuickItem *i)
void tst_QQuickPinchArea::scale()
{
QQuickView *window = createView();
+ QScopedPointer<QQuickView> scope(window);
window->setSource(testFileUrl("pinchproperties.qml"));
window->show();
- window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
+ QVERIFY(QTest::qWaitForWindowExposed(window));
QVERIFY(window->rootObject() != 0);
qApp->processEvents();
pinchSequence.release(0, p1, window).release(1, p2, window).commit();
}
QVERIFY(!root->property("pinchActive").toBool());
-
- delete window;
}
void tst_QQuickPinchArea::pan()
{
QQuickView *window = createView();
+ QScopedPointer<QQuickView> scope(window);
window->setSource(testFileUrl("pinchproperties.qml"));
window->show();
- window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
+ QVERIFY(QTest::qWaitForWindowExposed(window));
QVERIFY(window->rootObject() != 0);
qApp->processEvents();
QTest::touchEvent(window, device).release(0, p1, window).release(1, p2, window);
QVERIFY(!root->property("pinchActive").toBool());
-
- delete window;
}
// test pinch, release one point, touch again to continue pinch
void tst_QQuickPinchArea::retouch()
{
QQuickView *window = createView();
+ QScopedPointer<QQuickView> scope(window);
window->setSource(testFileUrl("pinchproperties.qml"));
window->show();
- window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
+ QVERIFY(QTest::qWaitForWindowExposed(window));
QVERIFY(window->rootObject() != 0);
qApp->processEvents();
QCOMPARE(startedSpy.count(), 2);
QCOMPARE(finishedSpy.count(), 1);
}
-
- delete window;
}
void tst_QQuickPinchArea::transformedPinchArea_data()
QFETCH(bool, shouldPinch);
QQuickView *view = createView();
+ QScopedPointer<QQuickView> scope(view);
view->setSource(testFileUrl("transformedPinchArea.qml"));
view->show();
- view->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(view));
+ QVERIFY(QTest::qWaitForWindowExposed(view));
QVERIFY(view->rootObject() != 0);
qApp->processEvents();
pinchSequence.release(0, p1, view).release(1, p2, view).commit();
QCOMPARE(pinchArea->property("pinching").toBool(), false);
}
-
- delete view;
}
QQuickView *tst_QQuickPinchArea::createView()