From d5cde738b7b9194c03df88538d1f6c571671d6d8 Mon Sep 17 00:00:00 2001 From: zhaikangning Date: Tue, 26 Oct 2021 15:59:37 +0800 Subject: [PATCH] update wlan more item while update wireless net area;modified according to pr suggestions --- src/frontend/tab-pages/wlanpage.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index acfb1e65..eb800215 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -82,10 +82,10 @@ void WlanPage::initWlanUI() m_inactivatedNetListWidget->setFrameShape(QFrame::Shape::NoFrame); m_inactivatedNetListWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - m_inactivatedWlanListAreaLayout->addWidget(m_inactivatedNetListWidget); - addWlanMoreItem(); + m_inactivatedWlanListAreaLayout->addWidget(m_inactivatedNetListWidget); + m_activatedNetListWidget = new QListWidget(m_activatedNetFrame); m_activatedNetListWidget->setFrameShape(QFrame::Shape::NoFrame); m_activatedNetListWidget->setContentsMargins(MAIN_LAYOUT_MARGINS); @@ -305,8 +305,7 @@ void WlanPage::deleteWirelessItemFormMap(QMap &wirele } WlanListItem *p_wlanItem = (WlanListItem *)wirelessListWidget->itemWidget(p_listWidgetItem); - if (nullptr == p_wlanItem) - { + if (nullptr == p_wlanItem) { qWarning() << LOG_FLAG << "p_wlanItem is null"; return; } @@ -782,6 +781,9 @@ void WlanPage::updateWirelessNetArea(QString uuid, QString ssid, QString devName QListWidgetItem *p_listWidgetItem = addNewItem(wirelessNetItem, m_inactivatedNetListWidget); m_wirelessNetItemMap.insert(wirelessNetItem.m_NetSsid, p_listWidgetItem); + // 更新‘更多’条目,以保证其处于listwidget的最底部 + addWlanMoreItem(); + return; } @@ -977,7 +979,7 @@ void WlanPage::onRefreshIconTimer() if (nullptr == p_wlanItem) { qDebug() << LOG_FLAG << "p_wlanItem is null continue"; - continue; + continue;//暂时先保持continue,后续讨论是否使用break直接跳出循环 } // 该item是‘更多’条目,不需要更新