From 890c52c74e82b28728d9b3cd4918f9ebaf382842 Mon Sep 17 00:00:00 2001 From: zhangyuanyuan1 Date: Wed, 26 Jul 2023 17:52:14 +0800 Subject: [PATCH] =?UTF-8?q?bug=20184234=20=E8=B0=83=E6=95=B4WiFi=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E5=AF=86=E7=A0=81=E7=95=8C=E9=9D=A2=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/tab-pages/wlanpage.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/frontend/tab-pages/wlanpage.cpp b/src/frontend/tab-pages/wlanpage.cpp index 9240bcd3..3a504bfc 100644 --- a/src/frontend/tab-pages/wlanpage.cpp +++ b/src/frontend/tab-pages/wlanpage.cpp @@ -893,12 +893,16 @@ void WlanPage::onDeviceManagedChanged(QString deviceName, bool managed) void WlanPage::onInactivateListWidgetItemChanged(QListWidgetItem *current, QListWidgetItem *previous) { - if (previous != nullptr) { + if (previous != nullptr && previous->sizeHint().height() > NORMAL_HEIGHT) { + QSize normalSize(previous->sizeHint().width(), NORMAL_HEIGHT); previous->setSizeHint(normalSize); WlanListItem *p_wlanItem = (WlanListItem*)m_inactivatedNetListWidget->itemWidget(previous); - p_wlanItem->setExpanded(false); + if (p_wlanItem != nullptr) { + p_wlanItem->setExpanded(false); + } } + if (current != nullptr) { current->setSelected(false); } @@ -906,9 +910,13 @@ void WlanPage::onInactivateListWidgetItemChanged(QListWidgetItem *current, QList void WlanPage::setInactivateListItemNoSelect() { - if (m_inactivatedNetListWidget->currentItem() != nullptr) { + if (m_inactivatedNetListWidget->currentItem() != nullptr + && m_inactivatedNetListWidget->currentItem()->sizeHint().height() > NORMAL_HEIGHT) { + WlanListItem *p_wlanItem = (WlanListItem*)m_inactivatedNetListWidget->itemWidget(m_inactivatedNetListWidget->currentItem()); - p_wlanItem->setExpanded(false); + if (p_wlanItem != nullptr) { + p_wlanItem->setExpanded(false); + } m_inactivatedNetListWidget->currentItem()->setSelected(false); } } @@ -1149,6 +1157,7 @@ void WlanPage::onItemHeightChanged(const bool isExpanded, const QString &ssid) if (isExpanded) { if (m_expandedItem != p_listWidgetItem) { + onInactivateListWidgetItemChanged(p_listWidgetItem, m_expandedItem); qDebug()<