What's the easiest way to clear the whole table at once? Especially if ou don't know the size of it so using QTableSelection is not possible. I know about clearCell() and clearSelection() but in both cases I need table size.
What's the easiest way to clear the whole table at once? Especially if ou don't know the size of it so using QTableSelection is not possible. I know about clearCell() and clearSelection() but in both cases I need table size.
As far as I remember the quickest way to clear the whole table was to delete its all rows (removeRow() or removeRows()) and create them again (new QTableItem...). The number of rows and columns can be obtained with numRows() and numCols(). You can use them with clearCell() too:
Qt Code:
for(int r=0;r<numRows();r++) for(int c=0;c<numCols();c++) clearCell(c,r);To copy to clipboard, switch view to plain text mode
Bookmarks