76
void GestureTest::sendTouchPress(qint64 timestamp, int id, QPointF pos)
78
sendTouch(timestamp, id, pos, Qt::TouchPointPressed, QEvent::TouchBegin);
81
void GestureTest::sendTouchUpdate(qint64 timestamp, int id, QPointF pos)
83
sendTouch(timestamp, id, pos, Qt::TouchPointMoved, QEvent::TouchUpdate);
86
void GestureTest::sendTouchRelease(qint64 timestamp, int id, QPointF pos)
88
sendTouch(timestamp, id, pos, Qt::TouchPointReleased, QEvent::TouchEnd);
91
void GestureTest::sendTouch(qint64 timestamp, int id, QPointF pos,
92
Qt::TouchPointState pointState, QEvent::Type eventType)
94
m_fakeTimerFactory->updateTime(timestamp);
96
QTouchEvent::TouchPoint point;
98
point.setState(pointState);
100
point.setScenePos(pos);
103
QList<QTouchEvent::TouchPoint> points;
106
QTouchEvent touchEvent(eventType, m_device, Qt::NoModifier, Qt::TouchPointPressed, points);
107
QCoreApplication::sendEvent(m_view, &touchEvent);
109
QQuickWindowPrivate *windowPrivate = QQuickWindowPrivate::get(m_view);
110
windowPrivate->flushDelayedTouchEvent();
113
void GestureTest::passTime(qint64 timeSpanMs)
115
qint64 finalTime = m_fakeTimerFactory->timeSource()->msecsSinceReference() + timeSpanMs;
116
m_fakeTimerFactory->updateTime(finalTime);
75
119
////////////////////////// TouchMemento /////////////////////////////
77
121
TouchMemento::TouchMemento(const QTouchEvent *touchEvent)