[python] Qt4 compatibility fix.