添加按钮 void QTableWidget::setCellWidget ( int row, int column, QWidget * widget ) widget可以是自己定义的按钮 class MyPushButton : public QPushButton { Q_OBJECT public: explicit MyPushButton(int i, int j, int flag); ~MyPushButton(); void mySetText();//i对应端口信息 } m