QTableWidget* table = new QTableWidget(); QTableWidgetItem* item = new QTableWidgetItem("Hello"); table->setItem(0, 0, item);
QTableWidget* table = new QTableWidget(); QTableWidgetItem* item = new QTableWidgetItem(); item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); item->setCheckState(Qt::Checked); table->setItem(1, 1, item);
QTableWidget* table = new QTableWidget(); QPushButton* btn = new QPushButton("Click me"); QWidget* widget = new QWidget(); QHBoxLayout* layout = new QHBoxLayout(widget); layout->addWidget(btn); layout->setAlignment(Qt::AlignCenter); widget->setLayout(layout); table->setCellWidget(2, 2, widget);These examples utilize the Qt package library.