why QTreeWidget::findItems failed?
-
why QTreeWidget::findItems failed?
i set the 1st param to the Text which is the same i setText when it's created,
and the 2nd param to Qt::Exactly
3rd param to 0
but it always return a empty List.... -
Hi,
Without any code nor dataset you use it's impossible to tell you why. Did you mean Qt::MatchExactly ?
-
eg. when create QTreeWidgetItem, pTreeWidgetItem->setText(0, "aaa");
only when this is the root item, i can use findItems get it.
otherwise, when i use findItems("aaa", Qt::MatchExactly, 0), it return 0.
should i do sth when the item which i want to find is not a root but a Child Item? -
Can you post the code?
TIP:
Qt::MatchExactly
uses QVariant-based match. If you're sure the type is a string I suggest to useQt::MatchFixedString
-
Qt::Recursively should be added