How not to delete column names in QTableWidget
I am trying to delete all rows from tablewidget but it delete column names also
while (ui->tableWidget->rowCount() > 1)
Do you have any ideas how to resolve it thanks.
that really 100% depends on the model implementation. try
If it doesn't work then separate QTableWidget into a QTableView and a QStandardItemModel (QStandardItemModel keeps the column headers even if there are no rows)
@VRonin I am trying it but it doesnt save column names (maybe there are way how to rewrite column names programly)
I checked the source and removeRows does not delete
horizontalHeaderItemsso the problem seems to be elsewhere. Can you show us what are you doing in the rest of your code?
@VRonin Thanks it helps (the matter I failed is that I use ui->tableWidget->clear(); )