void SceIPGWidget::on_listWidget_itemDoubleClicked(QListWidgetItem *item)
{
QWidget* widget = ui->listWidget->itemWidget(item); // 获取里面的QWidget
if(widget != NULL)
{
QList<QLabel*> labelList = widget->findChildren<QLabel*>(); //获取所有的Qlabel
foreach(QLabel *label, labelList)
{
if(label->objectName() == "label_sn")
{
QString strSN = label->text();
return;
}
}
}
}
参考:https://blog.csdn.net/chen1231985111/article/details/86304481