[置顶] QT 获得tableWidget中QComboBox的内容

 

QWidget * QTableWidget::cellWidget ( int row, int column ) const

Returns the widget displayed in the cell in the given row and column.



QWidget * widget=ui->tableWidget->cellWidget(i,0);//获得widget

QComboBox *combox=(QComboBox*)widget;//强制转化为QComboBox

QString string=combox->currentText();
 qDebug()<<string;



你可能感兴趣的:(String,qt)