Fix:bug Wlanlistitem fold problem when click other component http://172.17.66.192/biz/bug-view-89399.html

This commit is contained in:
zhouxiali 2021-11-08 16:45:21 +08:00
parent b3e6aa8777
commit 36a8740e52
1 changed files with 8 additions and 0 deletions

View File

@ -164,6 +164,12 @@ void WlanListItem::leaveEvent(QEvent *event)
bool WlanListItem::eventFilter(QObject *watched, QEvent *event)
{
if (watched == m_showPwdButton || watched == m_autoConnectCheckBox) {
if (event->type() == QEvent::FocusIn) {
m_pwdLineEdit->setFocus();
}
}
if (watched == m_pwdLineEdit) {
if (event->type() == QEvent::FocusOut) {
m_focusIsOut = true;
@ -216,6 +222,7 @@ void WlanListItem::initWlanUI()
m_pwdLineEdit->setLayout(m_pwdLineEditLyt);
m_showPwdButton = new QPushButton(m_pwdLineEdit);
m_showPwdButton->installEventFilter(this);
m_showPwdButton->setFixedSize(SHOW_PWD_BUTTON_SIZE);
m_showPwdButton->setAutoFillBackground(false);
m_showPwdButton->setIcon(QIcon(":/res/h/hide-pwd.png"));
@ -240,6 +247,7 @@ void WlanListItem::initWlanUI()
m_autoConnectFrame->setLayout(m_autoConnectFrameLyt);
m_autoConnectCheckBox = new QCheckBox(m_autoConnectFrame);
m_autoConnectCheckBox->installEventFilter(this);
m_autoConnectCheckBox->setChecked(true);
m_autoConnectCheckBox->setFixedSize(SHOW_PWD_BUTTON_SIZE);
m_autoConnectFrameLyt->addWidget(m_autoConnectCheckBox);