summaryrefslogtreecommitdiffstats
path: root/src/testlib/qtesttouch.h
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2011-09-21 09:23:51 +0200
committerQt by Nokia <qt-info@nokia.com>2011-09-21 13:46:08 +0200
commitbc60b6787c791be0168820c42febfdb57b5070e0 (patch)
treeab4f5214d855841e4fefb9d97d2d10cc2269952e /src/testlib/qtesttouch.h
parent294a3e7b4797f508ebe629000ee2b2b7c7bd7302 (diff)
testlib: Separate the gui- and widgets-specific api
Group the widgets-specific ("legacy") api under as few ifdefs as possible. (The diff can look confusing; rest assured that this change "only" moves entire functions around in the files.) Change-Id: I27bdec7d1c96d0b040dc22a8fed17e4e47766276 Reviewed-on: http://codereview.qt-project.org/5290 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Matthew Cattell <matthew.cattell@nokia.com>
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