why do not simply call QTableWidget::clear?
PS. please, use tags CODE .