Posts

Showing posts with the label pyqt

PyQt - Column of Checkboxes in a QTableView

PyQt - Column of Checkboxes in a QTableView I am dynamically creating a QTableView from a Pandas dataframe. I have example code here. I can create the table, with the checkboxes but I cannot get the checkboxes to reflect the model data, or even to change at all to being unchecked. I am following example code from this previous question and taking @raorao answer as a guide. This will display the boxes in the table, but non of the functionality is working. Can anyone suggest any changes, or what is wrong with this code. Why is it not reflecting the model, and why can it not change? Do check out my full example code here. Edit one : Update after comment from Frodon : corrected string cast to bool with a comparison xxx == 'True' class CheckBoxDelegate(QtGui.QStyledItemDelegate): """ A delegate that places a fully functioning QCheckBox in every cell of the column to which it's applied """ def __init__(self, parent): QtGu...