Set a text of cell in QTreeWidget
Solved
General and Desktop
-
Hi,
-
@SGaist said in Set a text of cell in QTreeWidget:
Hi,
Thanks so it pass a column number and text, but how can I tell which row? I need to get QTreeWidgetItem from QTreeWidget somehow.
-
IIRC each row is a topLevelItem with children under them so in this case Hello is the topLevelItem and branches on from there.
So Day would be the child of nice which is a child of hello.
QTreeWidgetItem *item = ui->treeWidget->topLevelItem(row)->child(row)->child(row); // in this case row = 0 item->setText(col, "TEXT"); // where in this case col would be 1
or something along those lines.