changing the checkstate of all the child item by checking the root item in Qtree widget
-
@kook said in changing the checkstate of all the child item by checking the root item in Qtree widget:
its not changing the checked state of children
Come on, that's because I did not add the code to change the checked state. Add that part:
void MainWindow::on_treeWidget_itemChanged(QTreeWidgetItem *item, int column) for (int i = 0; i < item->childCount(); ++i) { qDebug() << item->child(i)->text(0); item->child(i)->setCheckState(0, item->checkState(0)); on_treeWidget_itemChanged(item->child(i), column); } }
-
@kook said in changing the checkstate of all the child item by checking the root item in Qtree widget:
its not changing the checked state of children
Come on, that's because I did not add the code to change the checked state. Add that part:
void MainWindow::on_treeWidget_itemChanged(QTreeWidgetItem *item, int column) for (int i = 0; i < item->childCount(); ++i) { qDebug() << item->child(i)->text(0); item->child(i)->setCheckState(0, item->checkState(0)); on_treeWidget_itemChanged(item->child(i), column); } }