BUG: Coerce new event code to QEvent.Type.

In PySide, QEvent strictly only accepts objects of type QEvent.Type. The
integer returned from QEvent.registerEventType() needs to be coerced.