//To set the value: int valueIWant = 5; ui->tableWidget->cellWidget(0,2)->setProperty("value",valueIWant);" //And to read the value: int actualValue = ui->tableWidget->cellWidget(0,2)->property("value").value<int>();