why QTreeWidget::findItems failed?
-
wrote on 26 Mar 2015, 10:31 last edited by
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 ?
-
wrote on 27 Mar 2015, 02:33 last edited by
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? -
wrote on 27 Mar 2015, 10:50 last edited by mcosta
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
-
wrote on 28 Mar 2015, 02:25 last edited by
Qt::Recursively should be added
5/5