fix(wlan device combobox): modify logic of device combobox display

This commit is contained in:
zhangyuanyuan1 2023-10-09 10:17:53 +08:00
parent 7ce857f0c8
commit a85a549082
1 changed files with 18 additions and 21 deletions

View File

@ -294,9 +294,8 @@ void WlanPage::initDeviceCombox()
} }
} else { } else {
m_deviceFrame->hide(); m_deviceFrame->hide();
//解决因m_currentDevice被置空安全中心网络显示BUG m_currentDevice = "";
// m_currentDevice = ""; setDefaultDevice(WIRELESS, m_currentDevice);
// setDefaultDevice(WIRELESS, m_currentDevice);
} }
connect(m_deviceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(m_deviceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
@ -780,7 +779,6 @@ void WlanPage::deleteDeviceFromCombox(QString deviceName)
disconnect(m_deviceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), disconnect(m_deviceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &WlanPage::onDeviceComboxIndexChanged); this, &WlanPage::onDeviceComboxIndexChanged);
if (getSwitchBtnState()) {
if (0 == m_devList.count()) { if (0 == m_devList.count()) {
m_deviceFrame->hide(); m_deviceFrame->hide();
//m_tipsLabel->show(); //m_tipsLabel->show();
@ -800,7 +798,6 @@ void WlanPage::deleteDeviceFromCombox(QString deviceName)
setDefaultDevice(WIRELESS, m_currentDevice); setDefaultDevice(WIRELESS, m_currentDevice);
} }
} }
}
connect(m_deviceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), connect(m_deviceComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
this, &WlanPage::onDeviceComboxIndexChanged); this, &WlanPage::onDeviceComboxIndexChanged);