Changed approach to send events to Qt to be compatible with PySide.