Various Qt related hacks and cleanups to make forms work better