Orderless completion in QCompleter
-
Hi. I would like to implement orderless completion for my
QCompleter
. Let's say I have aQStringList
with itemsitem-one
,item-two
,item-three
. If I typethree item
(notice the space in between) the popup should showitem-three
. I did implementQSortFilterProxy
to split all the items in theQStringList
by hyphen. But even after playing around withsplitPath
method ofQCompleter
I cannot get it to work. -
@dheerajshenoy said in Orderless completion in QCompleter:
implement orderless completion for my QCompleter
What you describe does not sound like "orderless", but more like "match any substring".
What if you set
filterMode
toQt::MatchContains
?!
This will match anything that contains "item" and "three", so you will probably end up with your desired result. -
It works for the most part. The problem is that when I start typing the word and press space, the completion popup hides and is not shown.
-
@dheerajshenoy said in Orderless completion in QCompleter:
I start typing the word and press space, the completion popup hides and is not shown.
I think this is because the completer treats it as new match/word then.
Can't tell how to change this (or how to match a result that contains multiple, by whitespace separated, words)Maybe looking into the file path handling helps:
The input is separated by slash or backslash and split into the single layers of the tree