Now I am doing a editor with Qt, I want realize a function just like auto complete.

so how to realize this?