@mrjj Thanks I got it to work. ui->setupUi(this); ui->tableWidget->setColumnCount(2); ui->tableWidget->setRowCount(numberSet.size()); ui->tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); QStringList tableHeader = {"Number", "Result"}; ui->tableWidget->setHorizontalHeaderLabels(tableHeader); int rowCounter = 0; for(int i : numberSet) { ui->tableWidget->setItem(rowCounter, 0, new QTableWidgetItem(QString::number(i))); ui->tableWidget->setItem(rowCounter, 1, new QTableWidgetItem(someConversion(i))); rowCounter++; }