You can simulate touch events by calling qt_translateRawTouchEvent directly. (This method is not documented, but it is in qapplication.cpp and exported).
You want to put this at the top of your file:
// forward-declaration of Qt internal function Q_GUI_EXPORT void qt_translateRawTouchEvent(QWidget *window, QTouchEvent::DeviceType deviceType, const QList<QTouchEvent::TouchPoint> &touchPoints);
Function call syntax:
qt_translateRawTouchEvent(targetWidget, deviceType, points.values());
In your case, call this method using (NULL, QTouchEvent::TouchScreen, touchPoints) , where touchPoints is your list of points that the user has currently touched. This should work in Qt 4.7 and 4.8, at least perhaps earlier in Qt 5, but I have not tested this.
David faure
source share