这恐怕是最简单的写法了,逛论坛发现的,亲测好用
//ui 文件中定义
//QTreeWidget *treeWidget;
//...
//遍历treeWidget
QTreeWidgetItemIterator it(ui.treeWidget);
while (*it) {
//do something like
(*it)->text(0);
++it;
}
这恐怕是最简单的写法了,逛论坛发现的,亲测好用
//ui 文件中定义
//QTreeWidget *treeWidget;
//...
//遍历treeWidget
QTreeWidgetItemIterator it(ui.treeWidget);
while (*it) {
//do something like
(*it)->text(0);
++it;
}