[Qt-interest] Autocomplete

Eckhard Jokisch e.jokisch at orange-moon.de
Wed Nov 3 10:57:24 CET 2010


On Wednesday 03 November 2010 09:29:56 Joshua Wambua wrote:
> Hi
> 
> I have a widget that contains a QTextEdit which has auto complete enabled.
> 
> Now this autocompleter's data is static and is loaded on startup, but I
> would like to make it dynamic
> 
> Without impending performance. What is the best way to setup auto complete,
> so that for example if
> 
> Someone types users and then a (.) dot, the list will show all users
> 
> Thanks
> 
> 
> 
> Joshua
I think it's best to install an eventFilter, capture the (.) and then show the 
popup.
If you want to use different datachanging over time there seems to be no way to 
change data in an existing model. The only way is to initialize a new 
completer and then register it with the QTextEdit accordingly.

Cheers
Eckhard



More information about the Qt-interest-old mailing list