September 9, 2011

emmynet emmynet
Lab Rat
6 posts

How to generate a fake mouse events?

 

Hi,
i’m trying to generate a artificial (random pos) mouse events, using:
QMouseEvent and QCoreApplication::instance()->postEvent()
without success.
“Any ideas?” :(

3 replies

September 9, 2011

sierdzio sierdzio
Area 51 Engineer
4110 posts

you can use QTest::mouseMove(), ::mouseClick() etc.

More info:

Hope that helps.

 Signature 

(Z(:^

September 9, 2011

emmynet emmynet
Lab Rat
6 posts

Tnks,
I’ll try it!!!

September 10, 2011

Gerolf Gerolf
Robot Herder
3235 posts

But QtTest is to be used for test automation, not for productive code. IMHO you should not deploy it. From my POV, you should use platform specific code to do it or check, how QtTest does it and do it in the same way.

 Signature 

Nokia Certified Qt Specialist.
Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

 
  ‹‹ [KNotification] method sendEvent() is not called.      PostgreSql and problem with lastInsertId() ››

You must log in to post a reply. Not a member yet? Register here!