Disambiguated access to touch event API in QTestLib
Commit 079ec157f8
overloads
the touch event API in QTestLib so that QWindow * can be
passed directly to certain functions.
This fix disambiguates access to the new API by selecting
the QWindow * versions. This assumes that the QWidget *
versions are kept mostly for backwards compatibility.
Change-Id: Ib6b33edc64d81f300d4109d59fd29f25ccd605db
Reviewed-on: http://codereview.qt-project.org/4443
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
parent
1762bf3394
commit
9360ee1605
@ -1333,11 +1333,11 @@ void tst_QTouchEvent::crashInQGraphicsSceneAfterNotHandlingTouchBegin()
|
||||
|
||||
QPoint centerPos = view.mapFromScene(rect->boundingRect().center());
|
||||
// Touch the button
|
||||
QTest::touchEvent(view.viewport()).press(0, centerPos);
|
||||
QTest::touchEvent(view.viewport()).release(0, centerPos);
|
||||
QTest::touchEvent(view.viewport()).press(0, centerPos, static_cast<QWindow *>(0));
|
||||
QTest::touchEvent(view.viewport()).release(0, centerPos, static_cast<QWindow *>(0));
|
||||
// Touch outside of the button
|
||||
QTest::touchEvent(view.viewport()).press(0, view.mapFromScene(QPoint(10, 10)));
|
||||
QTest::touchEvent(view.viewport()).release(0, view.mapFromScene(QPoint(10, 10)));
|
||||
QTest::touchEvent(view.viewport()).press(0, view.mapFromScene(QPoint(10, 10)), static_cast<QWindow *>(0));
|
||||
QTest::touchEvent(view.viewport()).release(0, view.mapFromScene(QPoint(10, 10)), static_cast<QWindow *>(0));
|
||||
}
|
||||
|
||||
void tst_QTouchEvent::touchBeginWithGraphicsWidget()
|
||||
@ -1358,12 +1358,12 @@ void tst_QTouchEvent::touchBeginWithGraphicsWidget()
|
||||
QTest::qWaitForWindowShown(&view);
|
||||
view.fitInView(scene.sceneRect());
|
||||
|
||||
QTest::touchEvent()
|
||||
QTest::touchEvent(static_cast<QWindow *>(0))
|
||||
.press(0, view.mapFromScene(root->mapToScene(3,3)), view.viewport());
|
||||
QTest::touchEvent()
|
||||
QTest::touchEvent(static_cast<QWindow *>(0))
|
||||
.stationary(0)
|
||||
.press(1, view.mapFromScene(root->mapToScene(6,6)), view.viewport());
|
||||
QTest::touchEvent()
|
||||
QTest::touchEvent(static_cast<QWindow *>(0))
|
||||
.release(0, view.mapFromScene(root->mapToScene(3,3)), view.viewport())
|
||||
.release(1, view.mapFromScene(root->mapToScene(6,6)), view.viewport());
|
||||
|
||||
@ -1375,12 +1375,12 @@ void tst_QTouchEvent::touchBeginWithGraphicsWidget()
|
||||
root->reset();
|
||||
glassWidget->setWindowFlags(Qt::Window); // make the glassWidget a panel
|
||||
|
||||
QTest::touchEvent()
|
||||
QTest::touchEvent(static_cast<QWindow *>(0))
|
||||
.press(0, view.mapFromScene(root->mapToScene(3,3)), view.viewport());
|
||||
QTest::touchEvent()
|
||||
QTest::touchEvent(static_cast<QWindow *>(0))
|
||||
.stationary(0)
|
||||
.press(1, view.mapFromScene(root->mapToScene(6,6)), view.viewport());
|
||||
QTest::touchEvent()
|
||||
QTest::touchEvent(static_cast<QWindow *>(0))
|
||||
.release(0, view.mapFromScene(root->mapToScene(3,3)), view.viewport())
|
||||
.release(1, view.mapFromScene(root->mapToScene(6,6)), view.viewport());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user