Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, April 2007
How to generate mouse events in Qt


Message 1 in thread

Hello,

I have created a GUI application using Qt (3.3.2) on Red Hat Linux 9.0 in which I have defined event handlers for handling push button click/press events. 

If I am not using the mouse, given a set of x & y co-ordinates, how can I simulate or fake mouse click events and invoke the event handler that I have written for each of the push buttons. 

I have tried creating QMouseEvent object, but this does not seem to be enough.

Also, I have tried using QCustomEvent to do the same, but when I try to handle multiple QCustomEvents, it gives a runtime error saying Xlib: Unexpected: Out of sync. Is this a bug in QT?

Is it  possible to generate mouse click event and process them without the mouse in QT by explicitly generating the mouse event object (QMouseEvent) and invoke user defined event handlers for different buttons in the GUI?

Thank you,

Pankaj.