PDA

View Full Version : Clearing QTable



Lebowski
20th April 2006, 07:08
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.

wysota
20th April 2006, 08:24
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:


for(int r=0;r<numRows();r++)
for(int c=0;c<numCols();c++)
clearCell(c,r);