ok I fixed it with ui->tableWidget->setColumnCount(6); and now it is working as it should, thanks for all your help, regards!