Retrieving Column/Row from TreeWidgetItemIterator?
I'm currently experimenting with QTreeWidgets and am wondering if it's possible to retrieve the column/row count from finding an item in a tree view using QTreeWidgetItemIterator? I am just simply dropping the example in the class as a slot.
Code:
while (*it) {
if ((*it)->text(0) == itemText)
(*it)->setSelected(true);
++it;
}
//itemText's row and column?
Re: Retrieving Column/Row from TreeWidgetItemIterator?
I'm sorry I didn't mean the count. I'm wanting the row/column of where "itemText" is found.
Re: Retrieving Column/Row from TreeWidgetItemIterator?
if ((*it)->text(0) == itemText)
the column is 0 .
I think *it->parent() is more interesting in trees than the row. The row is relative to the parent.
Take a look a model view programming:
http://doc.qt.nokia.com/4.7/model-view-programming.html
http://doc.qt.nokia.com/4.7/images/modelview-models.png