I'm using Qt4.6 and I have a QComboBox with a QCompleter in it.
The usual functionality is to provide completion hints (these can be in a dropdown rather than inline - which is my usage) based on a prefix. For example, given
chicken soup
chilli peppers
grilled chicken
entering ch
would match chicken soup
and chilli peppers
but not grilled chicken
.
What I want is to be able to enter ch
and match all of them or, more specifically, chicken
and match chicken soup
and grilled chicken
.
I also want to be able to assign a tag like chs
to chicken soup
to produce another match which is not just on the text's content. I can handle the algorithm but,
Which of QCompleter's functions do I need to override?
I'm not really sure where I should be looking...
Based on @j3frea suggestion, here is a working example (using
PySide
). It appears that the model needs to be set every timesplitPath
is called (setting the proxy once insetModel
doesn't work).