summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtesttouch.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/testlib/qtesttouch.h')
-rw-r--r--src/testlib/qtesttouch.h42
1 files changed, 19 insertions, 23 deletions
diff --git a/src/testlib/qtesttouch.h b/src/testlib/qtesttouch.h
index 4562cd4c73..b5333f1114 100644
--- a/src/testlib/qtesttouch.h
+++ b/src/testlib/qtesttouch.h
@@ -79,61 +79,57 @@ namespace QTest
commit();
points.clear();
}
-#ifdef QT_WIDGETS_LIB
- QTouchEventSequence& press(int touchId, const QPoint &pt, QWidget *widget = 0)
+ QTouchEventSequence& press(int touchId, const QPoint &pt, QWindow *window = 0)
{
QTouchEvent::TouchPoint &p = point(touchId);
- p.setScreenPos(mapToScreen(widget, pt));
+ p.setScreenPos(mapToScreen(window, pt));
p.setState(Qt::TouchPointPressed);
return *this;
}
-#endif
- QTouchEventSequence& press(int touchId, const QPoint &pt, QWindow *window = 0)
+ QTouchEventSequence& move(int touchId, const QPoint &pt, QWindow *window = 0)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(window, pt));
- p.setState(Qt::TouchPointPressed);
+ p.setState(Qt::TouchPointMoved);
return *this;
}
-
-#ifdef QT_WIDGETS_LIB
- QTouchEventSequence& move(int touchId, const QPoint &pt, QWidget *widget = 0)
+ QTouchEventSequence& release(int touchId, const QPoint &pt, QWindow *window = 0)
{
QTouchEvent::TouchPoint &p = point(touchId);
- p.setScreenPos(mapToScreen(widget, pt));
- p.setState(Qt::TouchPointMoved);
+ p.setScreenPos(mapToScreen(window, pt));
+ p.setState(Qt::TouchPointReleased);
return *this;
}
-#endif
- QTouchEventSequence& move(int touchId, const QPoint &pt, QWindow *window = 0)
+ QTouchEventSequence& stationary(int touchId)
{
QTouchEvent::TouchPoint &p = point(touchId);
- p.setScreenPos(mapToScreen(window, pt));
- p.setState(Qt::TouchPointMoved);
+ p.setState(Qt::TouchPointStationary);
return *this;
}
+
#ifdef QT_WIDGETS_LIB
- QTouchEventSequence& release(int touchId, const QPoint &pt, QWidget *widget = 0)
+ QTouchEventSequence& press(int touchId, const QPoint &pt, QWidget *widget = 0)
{
QTouchEvent::TouchPoint &p = point(touchId);
p.setScreenPos(mapToScreen(widget, pt));
- p.setState(Qt::TouchPointReleased);
+ p.setState(Qt::TouchPointPressed);
return *this;
}
-#endif
- QTouchEventSequence& release(int touchId, const QPoint &pt, QWindow *window = 0)
+ QTouchEventSequence& move(int touchId, const QPoint &pt, QWidget *widget = 0)
{
QTouchEvent::TouchPoint &p = point(touchId);
- p.setScreenPos(mapToScreen(window, pt));
- p.setState(Qt::TouchPointReleased);
+ p.setScreenPos(mapToScreen(widget, pt));
+ p.setState(Qt::TouchPointMoved);
return *this;
}
- QTouchEventSequence& stationary(int touchId)
+ QTouchEventSequence& release(int touchId, const QPoint &pt, QWidget *widget = 0)
{
QTouchEvent::TouchPoint &p = point(touchId);
- p.setState(Qt::TouchPointStationary);
+ p.setScreenPos(mapToScreen(widget, pt));
+ p.setState(Qt::TouchPointReleased);
return *this;
}
+#endif
private:
#ifdef QT_WIDGETS_LIB