PDA

View Full Version : look through a QTreeWidget



mattia
20th December 2007, 14:19
Hello, i have a QTreeWidget and i want to look through all the QTreeWidgetItem housed in my QTreeWidget. Is there a way to know how many QTreeWidget i have in?
Thx

marcel
20th December 2007, 14:27
Yes, you need a recursive solution. Search the forums, there are a couple of these solutions around.

http://www.qtcentre.org/forum/f-qt-programming-2/t-qtreewidget-parsing-data-7575.html/?highlight=recursive

mattia
20th December 2007, 14:35
I found this one
http://www.qtcentre.org/forum/f-qt-programming-2/t-qtreewidget-parsing-data-7575.html
but i have a QTreeWidget not a QTreeWidgetItem so i can't use the childCount() method, i'd like just to know the QTreeWidget size....
thx

marcel
20th December 2007, 14:36
The size in what? pixels? Items?

jpn
20th December 2007, 14:43
What about using QTreeWidget::findItems()? You could search for "*" and pass wildcard and recursive matching flags. Notice also QTreeWidgetItemIterator in case you want to iterate certain items.

mattia
20th December 2007, 15:07
thx, the iterator is just rigth for me ;)