I'm using squishtest
library for manipulating Qt application from my Python code and attempting to use event handlers as follows:
import squishtest
def handle_mouse_event(event):
print 'Clicked!'
squishtest.startApplication('application')
squishtest.installEventHandler('QMouseEvent', handle_mouse_event)
Unfortunately this doesn't work, i.e. nothing happens on clicking elements inside the app, however it works in case I run equivalent of this code inside the Squish IDE in Squish runtime:
import squish
def handle_mouse_event(event):
print 'Clicked!'
squish.startApplication('application')
squish.installEventHandler('QMouseEvent', handle_mouse_event)
What is the difference and how to get event handlers working with squishtest
?
Python 2.7.14, Squish 6.3.1, Ubuntu 16.04