我有一个包含 5 列的 QTableWidget,如何将第 2 列的所有项目设置为 QProgressBar?
我试过类似的东西:
self.downloads_table = QtGui.QTableWidget(0, 5)
self.downloads_table.setItemDelegateForColumn(2, DownloadDelegate(self))
DownloadDelegate 在哪里:
class DownloadDelegate(QItemDelegate):
def __init__(self, parent=None):
super(DownloadDelegate, self).__init__(parent)
def createEditor(self, parent, option, index):
return QProgressBar(parent)
但是进度条根本不显示。任何的想法?