Qt4 - Simplification and fix the IM interaction.