Update data to QTreewidget every sec
-
What is the problem?
What help do you need?
Where does the data come from? -
What help do you need?
Most simple solution: in updateData() you recreate the complete tree (delete all items and then add new items based on current data). -
What help do you need?
Most simple solution: in updateData() you recreate the complete tree (delete all items and then add new items based on current data).@jsulm
I have done that but the text added byitem1->setText(0,"data1");
is not getting deleted. I have used the following code to delete all the items.for(int i=0;i< ui->treeWidget->topLevelItemCount();++i){ qDeleteAll(ui->treeWidget->topLevelItem(i)->takeChildren()); }
-
hi
Cant
http://doc.qt.io/qt-5/qtreewidget.html#clear
be used ? -
hi
Cant
http://doc.qt.io/qt-5/qtreewidget.html#clear
be used ? -
@saitej
No matter how you remove the items, it cannot
keep open/close status since you remove the items.