[Interest] Tree model filtering with QCompleter

Clément Geiger clement.geiger at gmail.com
Thu Dec 18 11:34:04 CET 2014


Hi,

I'm implementing a basic completer for a code editor. One of the things
that can completed is a path-like string, for instance
"Perception/Persons/4352".

I have the completer working just fine when the model nodes are
"Perception", "Persons" and "4352", but I wanted to experiment and try to
include the trailing "/" in it (to show the user which entry has children
and which hasn't).

So I went ahead and now my model has nodes like "Perception/", "Persons/"
and "4352".

However if I type "Perception/" and invoke the completer at this point, the
completion popup will show me these possibilities:
 - "Perception/"
 - "Persons/"

So it's showing the parent node, "Perception/", and its child, "Persons/".

Reading QCompleter source code, I cannot figure how the completion match
can include one parent and its children at the same time. If anyone has an
explanation, or idea how to go around this behavior, I'd glad to hear it!

Thanks you for reading me,

Clément
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20141218/1702fb27/attachment.html>


More information about the Interest mailing list