2016-05-04 29 views

回答

1

http://doc.qt.io/qt-5/qtreewidget.html#setItemWidget將做的工作適合你

只是把它與每一行的任何你需要的小工具。

歡呼

/編輯:

可以說你的列「狀態」的列索引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 
+0

感謝,我讀了它,我不能得到代碼工作 – Mugtaba

+0

做了一個編輯,應該會幫助你 – Zaiborg

+0

非常感謝,它工作得很好。 – Mugtaba