Page 1 of 1

Simulate a click

Posted: Tue Dec 26, 2017 6:11 pm
by dmmontes
Hi,

I have been trying to simulate a click in main windows but it has been imposible. I would like to know if is there any method to do this? I have seen method onWheelEvent that simulate a displacement or zoom. I want the same, but for a click, is there something?

Thank you and sorry for my english!

Re: Simulate a click

Posted: Wed Dec 27, 2017 8:51 am
by daniel
You would have to call 'mousePressEvent' and then 'mouseReleaseEvent' with the right (fake) event I guess? (i.e. with the right or left mouse button pressed). However I'm not sure that's possible :D

Therefore one would need to create an intermediate function that generalizes the clicking process.

But the real question is: what are you trying to achieve? Isn't there a cleaner way to do it? :D