Replace removeAllRows with setRowCount(0)