PDA

View Full Version : QTreeWidget::findItems only searches top level items ?



krisha
6th March 2006, 17:41
if I have a QTreeWidget like this one:

"Base"
+-"child1"
+-"child2"

and I use QTreeWidget->findItems ( QString ( "child" ), Qt::MatchContains )
it will return an empty list. If I search for "ba" in the same tree it correctly returns a list with one item (the "Base" item).

if I put more than the "Base" item to the same level I also can search for it... but no childs.

is this behavior right or did I use findItems wrong ?

jpn
6th March 2006, 18:03
Try using the combination of "Qt::MatchContains | Qt::MatchRecursive" as flags.

krisha
7th March 2006, 00:27
thanks worked :) didn't see the flag and wondered an hour ...

ghl800
27th October 2011, 08:28
Add Qt::MatchRecursive Flag