Suppose I have a pyqt4 table widget, for example:
self.table = QtGui.QTableWidget(3,4)
With self.table.clear()
I can remove all contents of the table. However how can I delete all cells of the table, not only the content?
Alternatively, you can set the row and column counts:
self.table.setRowCount(0)
self.table.setColumnCount(0)
Haven't tried it, but you can try:
for i in reversed(range(self.table.rowCount())):
self.table.removeRow(i)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With