在QTableWidget中添加按钮
作者:互联网
环境:Qt 5.14
auto button = new QPushButton(QStringLiteral("按钮"), ui->tableWidget_1);
button->setFixedSize(60, 22);
auto cellWidget = new QWidget(this);
auto layout = new QHBoxLayout(cellWidget);
layout ->addWidget(button);
cellWidget->setLayout(layout);
ui->tableWidget_1->setCellWidget(rowIndex, colIndex, cellWidget);
标签:layout,auto,cellWidget,QTableWidget,tableWidget,添加,按钮,new,button 来源: https://www.cnblogs.com/yitouniu/p/16545328.html