| 32 | ui->cbListenAll->setChecked(m_Para->GetListenAll()); |
| 33 | ui->lvListen->setModel(&m_ModelNetWorkInterface); |
| 34 | foreach(auto iface, QNetworkInterface::allInterfaces()) { |
| 35 | qDebug(log) << iface; |
| 36 | auto entry = iface.addressEntries(); |
| 37 | if(iface.flags() & QNetworkInterface::IsLoopBack) |
| 38 | continue; |
| 39 | /*if(!(iface.flags() & QNetworkInterface::CanBroadcast)) |
| 40 | continue;//*/ |
| 41 | foreach(auto e, entry) { |
| 42 | if(!e.broadcast().isNull()) { |
| 43 | QStandardItem* item = new QStandardItem(e.ip().toString()); |
| 44 | item->setCheckable(true); |
| 45 | m_ModelNetWorkInterface.appendRow(item); |
| 46 | } |
| 47 | } |
| 48 | } |
| 49 | foreach(auto ip, m_Para->GetListen()) { |
| 50 | for (int row = 0; row < m_ModelNetWorkInterface.rowCount(); row++) { |
| 51 | QModelIndex index = m_ModelNetWorkInterface.index(row, 0); |