If you want to simulate clicks on widgets inside your application, check out the QTestEventList :
A QTestEventList can be populated with GUI events that can be saved as test data for later use or played back on any QWidget.
It allows you to perform keystrokes and various mouse events, but not the wheel. Regardless, the source code should provide recommendations on best practices for this kind of operation:
http://qt.gitorious.org/qt/qt/blobs/master/src/testlib/qtestmouse.h
http://qt.gitorious.org/qt/qt/blobs/master/src/testlib/qtestevent.h
OTOH, if you want you to simulate clicks outside your application (e.g. desktop icons, etc.) that are likely beyond the scope of the Qt API. To βtake full control of the mouseβ on Windows, this related question:
Windows mouse click simulation
... and instead, you can use an automation tool specifically designed for this task. Some options: Windows Auto It! , Mac Automator, and the iMacros website. You can even call a tool from Qt like QProcess .
Hostilefork
source share