在 Qt 中有什么方法可以在 QTreeWidget 项目之一中添加一个 processBar Something like this
最佳答案
http://doc.qt.io/qt-5/qtreewidget.html#setItemWidget会为你完成这项工作
只需使用您需要的任何小部件为每一行调用它。
干杯
/编辑:
假设您的“status”列有列索引 5
,那么它将是这样的:
QTreeWidgetItem* item = new QTreeWidgetItem(columnTextsStringList);
/*insert into tree here*/
QProgressBar* progBar = new QProgressBar;
treeWidget->setItemWidget(item, 5/*column of the status*/, progBar);
// no need to delete progBar, its now a child of treeWidget
// use progBar
关于c++ - 如何在 QTreeWidget 列中添加进度条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37021608/