In that case, I'd recommend to take a look at KDAB's blog entry about Qt Input Method In Depth

The followup article will be even more useful, but this one is already a good starting point.