[Qt-interest] QCompleter: combined completion mode?

Jonathan Kew jonathan_kew at sil.org
Fri Jun 26 19:24:22 CEST 2009


On 26 Jun 2009, at 17:37, Israel Brewster wrote:

> Is there any way to do a "combined completion mode" in a QCompleter?  
> That is, from what I can tell, you have your choice of  
> inlineCompletion, which fills in the remainder of the QLineEdit with  
> the most likely completion based on what you have typed, OR  
> popupCompletion, which just displays a menu of possible completions.  
> What I am looking for is a combination of the two: the QLineEdit is  
> filled in with the most likely, but it also shows a pop-up menu of  
> other possible completions. That way, if the "most likely"  
> completion is correct, you don't have to do anything, it is already  
> filled in. However, if it is wrong, you can just select the correct  
> one from the menu, rather than having to type out (sometimes  
> significantly) more of the word/phrase, and remember exactly how it  
> was formated. Is this possible?

Anything is possible, just a small matter of programming. :)

It's not exactly what you're asking for, but an alternative way to use  
the inline completion model is to allow the user to cycle through the  
possible completions for the prefix that has been typed. So if the  
first completion offered isn't what you want, you just press the  
completion shortcut key again to see the next option; no need to  
actually type out more of it. FWIW, this is the approach I've used in  
my app, and it seems to work pretty well.

JK




More information about the Qt-interest-old mailing list