PDA

View Full Version : need help with my QTreeWidgetItem List



patcito
6th July 2006, 01:20
hey all,
Im using a QList <QTreeWidgetItem *> to get all the selected item in my qtree.
Here is what its done:


void Getmydistro::on_treeWidget_clicked()
{
QList <QTreeWidgetItem *> selection;
selection << ui.treeWidget->selectedItems();
for(int i=0;i<selection.size();i++)
{
selection.at(i);
qDebug() << selection.at(i);
}
}


i would like to use some QTreeWidgetItem functions on each item of my QList such as "selection.at(i).text(0)" but it doesnt work as the QList contains pointers to each item. I couldnt figure out how to turn each item into an actual QTreeWidgetItem so I can apply QTreeWidgetItem´s functions to them. Any idea?

thanx in advance

Pat

jacek
6th July 2006, 01:34
Use -> instead of .

Chicken Blood Machine
6th July 2006, 18:02
. .