Search code examples
pythonpyqt4qtablewidgetqprogressbar

progress bar within a table in pyqt4


How could I use PyQt to add a progress bar as a cell in my TableView? For example, suppose I have a table that holds several running tasks and I would like one of the cells in each row to show the percentage of the completed task. Here is a quick example of what I mean.


Solution

  • from QT documentation Qtable implements QAstractItemView that has the method setIndexWidget(index, new widget()) that you can use to add the qprogressbar

    tableView.setIndexWidget(index, QProgressBar())