简体   繁体   English

如何在QTreeWidget Cloum中添加processBar

[英]How to Add processBar inside QTreeWidget cloum

有没有办法在Qt来添加processBar的QTreeWidget一个项目里面像这样的东西

http://doc.qt.io/qt-5/qtreewidget.html#setItemWidget will do the job for you http://doc.qt.io/qt-5/qtreewidget.html#setItemWidget将为您完成这项工作

just call it for each row with whatever widget you need. 只需使用所需的任何小部件为每一行调用它。

cheers 干杯

/edit: /编辑:

lets say your column 'status' has column index 5 , then it would be something like this: 假设您的“状态”列具有列索引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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM