for (int cc = m_historyLayout->layout()->count()-1; cc >= 0; --cc)
{
QLayoutItem *it = m_historyLayout->layout()->itemAt(cc);
QTableWidget *orderHistory = qobject_cast<QTableWidget *>(it->widget());
if (orderHistory != 0)
{
//doing something for orderHistory
}
}
QT-从QLayout中遍历出组件(Widget)
于 2020-06-10 23:01:21 首次发布