From c247596ed961304bc408833d84c493d7de67b9b4 Mon Sep 17 00:00:00 2001 From: chenlelin Date: Thu, 27 Feb 2020 16:13:38 +0800 Subject: [PATCH] fix the bug several connect buttons show in the net list --- mainwindow.cpp | 24 +++++----- mainwindow.h | 6 +-- oneconnform.cpp | 47 ++++++++++--------- oneconnform.h | 3 +- oneconnform.ui | 4 +- onelancform.cpp | 39 +++++++-------- onelancform.h | 1 + onelancform.ui | 4 +- wireless-security/dlgconnhidwifi.cpp | 20 +++++--- wireless-security/dlgconnhidwifileap.cpp | 3 +- wireless-security/dlgconnhidwifisecfast.cpp | 3 +- wireless-security/dlgconnhidwifisecleap.cpp | 3 +- wireless-security/dlgconnhidwifisecpeap.cpp | 6 ++- wireless-security/dlgconnhidwifisecpwd.cpp | 3 +- wireless-security/dlgconnhidwifisectls.cpp | 6 ++- wireless-security/dlgconnhidwifisectls.ui | 2 +- .../dlgconnhidwifisectunneltls.cpp | 6 ++- wireless-security/dlgconnhidwifiwep.cpp | 3 +- wireless-security/dlgconnhidwifiwpa.cpp | 4 +- wireless-security/kylinheadfile.h | 1 + 20 files changed, 109 insertions(+), 79 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 95151000..3d0af07d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -81,7 +81,7 @@ MainWindow::MainWindow(QWidget *parent) : lbLoadDown->move(41 + 132, 52 + 32); lbLoadDown->resize(65, 20); lbLoadUp = new QLabel(ui->centralWidget); - lbLoadUp->move(41 + 215, 52 + 32); + lbLoadUp->move(41 + 217, 52 + 32); lbLoadUp->resize(65, 20); topWifiListWidget = new QWidget(ui->centralWidget); @@ -1086,7 +1086,7 @@ void MainWindow::loadWifiListDone(QStringList slist) if(wname != "" && wname != "--"){ // 当前连接的wifi if(wname == actWifiName){ - connect(ccf, SIGNAL(selectedOneWifiForm(QString)), this, SLOT(oneTopWifiFormSelected(QString))); + connect(ccf, SIGNAL(selectedOneWifiForm(QString,int)), this, SLOT(oneTopWifiFormSelected(QString,int))); connect(ccf, SIGNAL(disconnActiveWifi()), this, SLOT(activeWifiDisconn())); ccf->setName(wname); ccf->setRate(wrate); @@ -1104,7 +1104,7 @@ void MainWindow::loadWifiListDone(QStringList slist) wifiListWidget->resize(440, wifiListWidget->height() + 60); OneConnForm *ocf = new OneConnForm(wifiListWidget, this, confForm, ksnm); - connect(ocf, SIGNAL(selectedOneWifiForm(QString)), this, SLOT(oneWifiFormSelected(QString))); + connect(ocf, SIGNAL(selectedOneWifiForm(QString,int)), this, SLOT(oneWifiFormSelected(QString,int))); ocf->setName(wname); ocf->setRate(wrate); ocf->setLine(true); @@ -1113,6 +1113,7 @@ void MainWindow::loadWifiListDone(QStringList slist) ocf->setWifiInfo(wsecu, wsignal, objKyDBus->dbusWifiMac); ocf->setConnedString(0, tr("Disconnected"), wsecu); ocf->move(0, j * 60); + ocf->setSelected(false, false); ocf->show(); j ++; @@ -1226,7 +1227,7 @@ void MainWindow::updateWifiListDone(QStringList slist) wifiListWidget->resize(440, wifiListWidget->height() + 60); OneConnForm *addItem = new OneConnForm(wifiListWidget, this, confForm, ksnm); - connect(addItem, SIGNAL(selectedOneWifiForm(QString)), this, SLOT(oneWifiFormSelected(QString))); + connect(addItem, SIGNAL(selectedOneWifiForm(QString,int)), this, SLOT(oneWifiFormSelected(QString,int))); addItem->setName(wname); addItem->setRate(wrate); addItem->setLine(false); @@ -1235,6 +1236,7 @@ void MainWindow::updateWifiListDone(QStringList slist) addItem->setWifiInfo(wsecu, wsignal, objKyDBus->dbusWifiMac); addItem->setConnedString(0, tr("Disconnected"), wsecu);//"未连接" addItem->move(0, posY); + addItem->setSelected(false, false); addItem->show(); count += 1; @@ -1848,7 +1850,7 @@ void MainWindow::oneTopLanFormSelected(QString lanName) } } -void MainWindow::oneWifiFormSelected(QString wifiName) +void MainWindow::oneWifiFormSelected(QString wifiName, int extendLength) { QList wifiList = wifiListWidget->findChildren(); @@ -1866,7 +1868,7 @@ void MainWindow::oneWifiFormSelected(QString wifiName) //是否与上一次选中同一个网络框 if (currSelNetName == wifiName){ - // 置选中,缩小所有选项卡 + // 缩小所有选项卡 for(int i = 0;i < wifiList.size(); i ++){ OneConnForm *ocf = wifiList.at(i); if(ocf->wifiName == wifiName){ @@ -1886,7 +1888,7 @@ void MainWindow::oneWifiFormSelected(QString wifiName) } currSelNetName = ""; } else { - // 设置选中,放大或缩小所有选项卡 + // 选中的选项卡放大,其他选项卡缩小 int selectY = 0; for(int i = 0;i < wifiList.size(); i ++){ @@ -1911,7 +1913,7 @@ void MainWindow::oneWifiFormSelected(QString wifiName) for(int i = 0;i < wifiList.size(); i ++){ OneConnForm *ocf = wifiList.at(i); if(ocf->y() > selectY){ - ocf->move(0, ocf->y() + 88); + ocf->move(0, ocf->y() + extendLength); } } @@ -1925,7 +1927,7 @@ void MainWindow::oneWifiFormSelected(QString wifiName) lastItem->setLine(false); } } -void MainWindow::oneTopWifiFormSelected(QString wifiName) +void MainWindow::oneTopWifiFormSelected(QString wifiName, int extendLength) { QList wifiList = topWifiListWidget->findChildren(); @@ -2119,7 +2121,7 @@ void MainWindow::disWifiDone() ocf->setConnedString(1, tr("Disconnected"), "");//"未连接" ocf->isConnected = false; ocf->setTopItem(false); - disconnect(ocf, SIGNAL(selectedOneWifiForm(QString)), this, SLOT(oneTopWifiFormSelected(QString))); + disconnect(ocf, SIGNAL(selectedOneWifiForm(QString,int)), this, SLOT(oneTopWifiFormSelected(QString,int))); }else{ ocf->deleteLater(); } @@ -2169,7 +2171,7 @@ void MainWindow::keepDisWifiState() ocf->setConnedString(1, tr("Disconnected"), "");//"未连接" ocf->isConnected = false; ocf->setTopItem(false); - disconnect(ocf, SIGNAL(selectedOneWifiForm(QString)), this, SLOT(oneTopWifiFormSelected(QString))); + disconnect(ocf, SIGNAL(selectedOneWifiForm(QString,int)), this, SLOT(oneTopWifiFormSelected(QString,int))); }else{ ocf->deleteLater(); } diff --git a/mainwindow.h b/mainwindow.h index 0cdf1d0d..75edbf46 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -76,6 +76,7 @@ public: void setTrayIcon(QIcon icon); void setTrayLoading(bool isLoading); + void getActiveInfo(); void initTimer(); void changeTimerState(); @@ -116,15 +117,14 @@ public slots: void oneLanFormSelected(QString lanName); void oneTopLanFormSelected(QString lanName); - void oneWifiFormSelected(QString wifiName); - void oneTopWifiFormSelected(QString wifiName); + void oneWifiFormSelected(QString wifiName, int extendLength); + void oneTopWifiFormSelected(QString wifiName, int extendLength); void on_btnHotspot_clicked(); void on_btnHotspotState(); private: void checkSingle(); - void getActiveInfo(); void initNetwork(); void createTrayIcon(); void handleIconClicked(); diff --git a/oneconnform.cpp b/oneconnform.cpp index 9617e2f0..fa1dc4db 100644 --- a/oneconnform.cpp +++ b/oneconnform.cpp @@ -116,10 +116,8 @@ OneConnForm::OneConnForm(QWidget *parent, MainWindow *mainWindow, ConfForm *conf this->isSelected = false; this->isActive = false; - ui->wbg->setAttribute(Qt::WA_Hover,true);//开启悬停事件 - ui->wbg->installEventFilter(this); //安装事件过滤器 - ui->btnConn->setAttribute(Qt::WA_Hover,true); - ui->btnConn->installEventFilter(this); + this->setAttribute(Qt::WA_Hover,true); + this->installEventFilter(this); ui->lePassword->setAttribute(Qt::WA_Hover,true); ui->lePassword->installEventFilter(this); @@ -138,31 +136,30 @@ OneConnForm::~OneConnForm() } void OneConnForm::mousePressEvent(QMouseEvent *){ - emit selectedOneWifiForm(wifiName); + emit selectedOneWifiForm(wifiName,88); } //事件过滤器 bool OneConnForm::eventFilter(QObject *obj, QEvent *event) { - if(obj == ui->wbg) { + if (obj == this){ if(event->type() == QEvent::HoverEnter) { - ui->btnConn->show(); - ui->wbg->setStyleSheet("#wbg{border-radius:4px;background-color:rgba(255,255,255,0.1);}"); + if (this->isTopItem){ + qDebug()<<"hover enter the top item of the window"; + }else{ + if (this->isSelected){ + qDebug()<<"will not show btnConn and wbg"; + } else { + ui->btnConn->show(); + ui->wbg->setStyleSheet("#wbg{border-radius:4px;background-color:rgba(255,255,255,0.1);}"); + ui->wbg->show(); + } + } return true; } else if(event->type() == QEvent::HoverLeave){ ui->btnConn->hide(); ui->wbg->setStyleSheet("#wbg{border-radius:4px;background-color:rgba(255,255,255,0);}"); - return true; - } - } - - if(obj == ui->btnConn) { - if(event->type() == QEvent::HoverEnter) { ui->wbg->hide(); - ui->btnConn->show(); - return true; - } else if(event->type() == QEvent::HoverLeave){ - ui->wbg->show(); return true; } } @@ -244,12 +241,14 @@ void OneConnForm::setTopItem(bool isSelected){ ui->lbLoadDown->hide(); ui->btnDisConn->hide(); } + + this->isTopItem = true; } // 点击窗口下面的item时 void OneConnForm::setSelected(bool isSelected, bool isCurrName){ if(isSelected){ resize(422, 148); - ui->line->hide(); + ui->line->move(0, 146); ui->wbg->hide(); ui->wbg_2->hide(); ui->wbg_3->show(); @@ -266,7 +265,7 @@ void OneConnForm::setSelected(bool isSelected, bool isCurrName){ ui->lePassword->setEchoMode(QLineEdit::Normal); ui->checkBoxPwd->setChecked(true); - ui->line->show(); + ui->line->move(0, 58); ui->wbg->show(); ui->wbg_2->hide(); ui->wbg_3->hide(); @@ -288,6 +287,8 @@ void OneConnForm::setSelected(bool isSelected, bool isCurrName){ ui->lbSignal->show(); ui->btnDisConn->hide(); ui->btnHideConn->hide(); + + this->isTopItem = false; } // 点击连接隐藏wifi的item时 void OneConnForm::setHideItem(bool isHideItem, bool isShowHideBtn){ @@ -427,7 +428,7 @@ void OneConnForm::on_btnDisConn_clicked() mw->is_stop_check_net_state = 1; mw->on_btnHotspotState(); kylin_network_set_con_down(ui->lbName->text().toUtf8().data()); - disconnect(this, SIGNAL(selectedOneWifiForm(QString)), mw, SLOT(oneWifiFormSelected(QString))); + disconnect(this, SIGNAL(selectedOneWifiForm(QString,int)), mw, SLOT(oneWifiFormSelected(QString,int))); emit disconnActiveWifi(); } @@ -536,7 +537,7 @@ void OneConnForm::slotConnWifiResult(int connFlag){ if(connFlag == 2){ mw->currSelNetName = ""; - emit selectedOneWifiForm(ui->lbName->text()); + emit selectedOneWifiForm(ui->lbName->text(),58); resize(422, 118); ui->wbg->hide(); @@ -548,6 +549,7 @@ void OneConnForm::slotConnWifiResult(int connFlag){ ui->btnConn->hide(); ui->btnConnSub->hide(); ui->lbInfo->hide(); + ui->line->move(0, 116); ui->lePassword->show(); ui->checkBoxPwd->show(); @@ -609,4 +611,5 @@ void OneConnForm::stopWaiting(){ ui->lbWaitingIcon->hide(); mw->setTrayLoading(false); + mw->getActiveInfo(); } diff --git a/oneconnform.h b/oneconnform.h index e5ceffa0..17561cc6 100644 --- a/oneconnform.h +++ b/oneconnform.h @@ -67,10 +67,11 @@ public: bool isSelected; bool isActive; bool isConnected; + bool isTopItem; int signalLv; signals: - void selectedOneWifiForm(QString wifiName); + void selectedOneWifiForm(QString wifiName, int extendLength); void connDone(int connFlag); void disconnActiveWifi(); diff --git a/oneconnform.ui b/oneconnform.ui index 4459ec3d..96b21f17 100644 --- a/oneconnform.ui +++ b/oneconnform.ui @@ -205,7 +205,7 @@ - 198 + 200 35 16 16 @@ -241,7 +241,7 @@ - 215 + 217 32 65 20 diff --git a/onelancform.cpp b/onelancform.cpp index 00a0c906..60990d3b 100644 --- a/onelancform.cpp +++ b/onelancform.cpp @@ -81,10 +81,8 @@ OneLancForm::OneLancForm(QWidget *parent, MainWindow *mainWindow, ConfForm *conf this->isSelected = false; this->isActive = false; - ui->wbg_2->setAttribute(Qt::WA_Hover,true);//开启悬停事件 - ui->wbg_2->installEventFilter(this); //安装事件过滤器 - ui->btnConn->setAttribute(Qt::WA_Hover,true);//开启悬停事件 - ui->btnConn->installEventFilter(this); //安装事件过滤器 + this->setAttribute(Qt::WA_Hover,true); + this->installEventFilter(this); this->waitTimer = new QTimer(this); connect(waitTimer, SIGNAL(timeout()), this, SLOT(waitAnimStep())); @@ -106,25 +104,24 @@ void OneLancForm::mousePressEvent(QMouseEvent *){ //事件过滤器 bool OneLancForm::eventFilter(QObject *obj, QEvent *event) { - if(obj == ui->wbg_2) { + if (obj == this){ if(event->type() == QEvent::HoverEnter) { - ui->btnConn->show(); - ui->wbg_2->setStyleSheet("#wbg_2{border-radius:4px;background-color:rgba(255,255,255,0.1);}"); + if (this->isTopItem){ + qDebug()<<"hover enter the top item of the window"; + }else{ + if (this->isSelected){ + qDebug()<<"will not show btnConn and wbg_2"; + } else { + ui->btnConn->show(); + ui->wbg_2->setStyleSheet("#wbg_2{border-radius:4px;background-color:rgba(255,255,255,0.1);}"); + ui->wbg_2->show(); + } + } return true; } else if(event->type() == QEvent::HoverLeave){ ui->btnConn->hide(); ui->wbg_2->setStyleSheet("#wbg_2{border-radius:4px;background-color:rgba(255,255,255,0);}"); - return true; - } - } - - if(obj == ui->btnConn) { - if(event->type() == QEvent::HoverEnter) { ui->wbg_2->hide(); - ui->btnConn->show(); - return true; - } else if(event->type() == QEvent::HoverLeave){ - ui->wbg_2->show(); return true; } } @@ -153,7 +150,7 @@ void OneLancForm::setSelected(bool isSelected, bool isCurrName) resize(422, 168); ui->wbg->show(); ui->wbg_2->hide(); - ui->line->hide(); + ui->line->move(0, 166); ui->btnConn->hide(); ui->btnConnSub->show(); @@ -162,7 +159,7 @@ void OneLancForm::setSelected(bool isSelected, bool isCurrName) resize(422, 60); ui->wbg->hide(); ui->wbg_2->show(); - ui->line->show(); + ui->line->move(0, 58); if(isCurrName){ ui->btnConn->show(); }else{ @@ -174,6 +171,8 @@ void OneLancForm::setSelected(bool isSelected, bool isCurrName) } ui->btnDisConn->hide(); + + this->isTopItem = false; } void OneLancForm::setTopItem(bool isSelected) @@ -208,6 +207,8 @@ void OneLancForm::setTopItem(bool isSelected) ui->line->hide(); ui->lbLoadUpImg->show(); ui->lbLoadDownImg->show(); + + this->isTopItem = true; } void OneLancForm::setName(QString name){ diff --git a/onelancform.h b/onelancform.h index f20f39b6..991a11c4 100644 --- a/onelancform.h +++ b/onelancform.h @@ -55,6 +55,7 @@ public: void setConnedString(bool showLable, QString str); bool isSelected; + bool isTopItem; bool isActive; bool isConnected; QString lanName; diff --git a/onelancform.ui b/onelancform.ui index 8968e278..f5a4530f 100644 --- a/onelancform.ui +++ b/onelancform.ui @@ -146,7 +146,7 @@ - 198 + 200 35 16 16 @@ -172,7 +172,7 @@ - 215 + 217 32 65 20 diff --git a/wireless-security/dlgconnhidwifi.cpp b/wireless-security/dlgconnhidwifi.cpp index dc46a93e..bced119b 100644 --- a/wireless-security/dlgconnhidwifi.cpp +++ b/wireless-security/dlgconnhidwifi.cpp @@ -45,13 +45,21 @@ DlgConnHidWifi::DlgConnHidWifi(int type, MainWindow *mainWindow, QWidget *parent ui->lbNetName->setStyleSheet("QLabel{border:0px;color:rgba(255,255,255,0.97);background-color:transparent;}"); ui->lbSecurity->setStyleSheet("QLabel{border:0px;color:rgba(255,255,255,0.97);background-color:transparent;}"); - ui->cbxConn->setStyleSheet("QComboBox{padding-left:20px;font-size:13px;color:rgba(255,255,255,1);border:1px solid rgba(255, 255, 255, 0.05);background:rgba(255,255,255,0.08);}" - "QComboBox::drop-down{border:0;width:30px;}" - "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"); + ui->cbxConn->setAttribute(Qt::WA_TranslucentBackground);//设置窗口背景透明 + ui->cbxConn->setStyleSheet("QComboBox{padding-left:20px;font-size:13px;color:rgba(255,255,255,0.91);border:1px solid rgba(255, 255, 255, 0.05);background:rgba(255,255,255,0.08);}" + "QComboBox::drop-down{border:0px;width:30px;}" + "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}" + "QComboBox QAbstractItemView {border:1px solid rgba(255, 255, 255, 0.05);background-color: transparent;}" + "QComboBox QAbstractItemView::item{font-size:13px;color:rgba(255,255,255,0.91);height: 32px;background-color: rgba(19,19,20,0.95);}" + "QComboBox QAbstractItemView::item:selected{font-size:13px;color:rgba(0,0,0,0.91);background-color:lightgray;}"); + ui->cbxConn->setView(new QListView()); ui->leNetName->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); - ui->cbxSecurity->setStyleSheet("QComboBox{padding-left:20px;font-size:13px;color:rgba(255,255,255,1);border:1px solid rgba(255, 255, 255, 0.05);background:rgba(255,255,255,0.08);}" - "QComboBox::drop-down{border:0;width:30px;}" - "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"); + ui->cbxSecurity->setStyleSheet("QComboBox{padding-left:20px;font-size:13px;color:rgba(255,255,255,0.91);border:1px solid rgba(255, 255, 255, 0.05);background:rgba(255,255,255,0.08);}" + "QComboBox::drop-down{border:0px;width:30px;}" + "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}" + "QComboBox QAbstractItemView {border:1px solid rgba(255, 255, 255, 0.05);background-color: transparent;}" + "QComboBox QAbstractItemView::item{font-size:13px;color:rgba(255,255,255,0.91);height: 32px;background-color: rgba(19,19,20,0.95);}" + "QComboBox QAbstractItemView::item:selected{font-size:13px;color:rgba(0,0,0,0.91);background-color:lightgray;}"); ui->btnCancel->setStyleSheet("QPushButton{border:0px;border-radius:4px;background-color:rgba(255,255,255,0.12);color:white;font-size:14px;}" "QPushButton:Hover{border:0px solid rgba(255,255,255,0.2);border-radius:4px;background-color:rgba(255,255,255,0.2);}" diff --git a/wireless-security/dlgconnhidwifileap.cpp b/wireless-security/dlgconnhidwifileap.cpp index 67268fbd..aad18f86 100644 --- a/wireless-security/dlgconnhidwifileap.cpp +++ b/wireless-security/dlgconnhidwifileap.cpp @@ -49,7 +49,8 @@ DlgConnHidWifiLeap::DlgConnHidWifiLeap(QWidget *parent) : ui->cbxSecurity->setStyleSheet("QComboBox{padding-left:20px;font-size:13px;color:rgba(255,255,255,1);border:1px solid rgba(255, 255, 255, 0.05);background:rgba(255,255,255,0.08);}" "QComboBox::drop-down{border:0;width:30px;}" "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"); - ui->checkBoxPwd->setStyleSheet("QCheckBox::indicator {width: 18px; height: 9px;}" + ui->checkBoxPwd->setStyleSheet("QCheckBox {border:none;background:transparent;}" + "QCheckBox::indicator {width: 18px; height: 9px;}" "QCheckBox::indicator:checked {image: url(:/res/h/show-pwd.png);}" "QCheckBox::indicator:unchecked {image: url(:/res/h/hide-pwd.png);}"); diff --git a/wireless-security/dlgconnhidwifisecfast.cpp b/wireless-security/dlgconnhidwifisecfast.cpp index 87eface1..6c16cdd0 100644 --- a/wireless-security/dlgconnhidwifisecfast.cpp +++ b/wireless-security/dlgconnhidwifisecfast.cpp @@ -67,7 +67,8 @@ DlgConnHidWifiSecFast::DlgConnHidWifiSecFast(int type, QWidget *parent) : "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"); ui->leUserName->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); ui->lePassword->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); - ui->checkBoxPwd->setStyleSheet("QCheckBox::indicator {width: 18px; height: 9px;}" + ui->checkBoxPwd->setStyleSheet("QCheckBox {border:none;background:transparent;}" + "QCheckBox::indicator {width: 18px; height: 9px;}" "QCheckBox::indicator:checked {image: url(:/res/h/show-pwd.png);}" "QCheckBox::indicator:unchecked {image: url(:/res/h/hide-pwd.png);}"); diff --git a/wireless-security/dlgconnhidwifisecleap.cpp b/wireless-security/dlgconnhidwifisecleap.cpp index eea2be47..88bf4929 100644 --- a/wireless-security/dlgconnhidwifisecleap.cpp +++ b/wireless-security/dlgconnhidwifisecleap.cpp @@ -55,7 +55,8 @@ DlgConnHidWifiSecLeap::DlgConnHidWifiSecLeap(int type, QWidget *parent) : "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"); ui->leUserName->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); ui->lePassword->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); - ui->checkBox->setStyleSheet("QCheckBox::indicator {width: 18px; height: 9px;}" + ui->checkBox->setStyleSheet("QCheckBox {border:none;background:transparent;}" + "QCheckBox::indicator {width: 18px; height: 9px;}" "QCheckBox::indicator:checked {image: url(:/res/h/show-pwd.png);}" "QCheckBox::indicator:unchecked {image: url(:/res/h/hide-pwd.png);}"); diff --git a/wireless-security/dlgconnhidwifisecpeap.cpp b/wireless-security/dlgconnhidwifisecpeap.cpp index 2b271339..8fc36f45 100644 --- a/wireless-security/dlgconnhidwifisecpeap.cpp +++ b/wireless-security/dlgconnhidwifisecpeap.cpp @@ -65,7 +65,8 @@ DlgConnHidWifiSecPeap::DlgConnHidWifiSecPeap(int type, QWidget *parent) : "QComboBox::drop-down{border:0;width:30px;}" "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"); ui->leCaPwd->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); - ui->checkBoxPwd->setStyleSheet("QCheckBox::indicator {width: 18px; height: 9px;}" + ui->checkBoxPwd->setStyleSheet("QCheckBox {border:none;background:transparent;}" + "QCheckBox::indicator {width: 18px; height: 9px;}" "QCheckBox::indicator:checked {image: url(:/res/h/show-pwd.png);}" "QCheckBox::indicator:unchecked {image: url(:/res/h/hide-pwd.png);}"); ui->checkBoxCA->setStyleSheet("QCheckBox{color:rgba(255,255,255,0.97);background-color:transparent;}"); @@ -77,7 +78,8 @@ DlgConnHidWifiSecPeap::DlgConnHidWifiSecPeap(int type, QWidget *parent) : "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"); ui->leUserName->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); ui->lePassword->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); - ui->checkBoxPwdSec->setStyleSheet("QCheckBox::indicator {width: 18px; height: 9px;}" + ui->checkBoxPwdSec->setStyleSheet("QCheckBox {border:none;background:transparent;}" + "QCheckBox::indicator {width: 18px; height: 9px;}" "QCheckBox::indicator:checked {image: url(:/res/h/show-pwd.png);}" "QCheckBox::indicator:unchecked {image: url(:/res/h/hide-pwd.png);}"); diff --git a/wireless-security/dlgconnhidwifisecpwd.cpp b/wireless-security/dlgconnhidwifisecpwd.cpp index b83ff34b..ed911a89 100644 --- a/wireless-security/dlgconnhidwifisecpwd.cpp +++ b/wireless-security/dlgconnhidwifisecpwd.cpp @@ -55,7 +55,8 @@ DlgConnHidWifiSecPwd::DlgConnHidWifiSecPwd(int type, QWidget *parent) : "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"); ui->leUserName->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); ui->lePassword->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); - ui->checkBox->setStyleSheet("QCheckBox::indicator {width: 18px; height: 9px;}" + ui->checkBox->setStyleSheet("QCheckBox {border:none;background:transparent;}" + "QCheckBox::indicator {width: 18px; height: 9px;}" "QCheckBox::indicator:checked {image: url(:/res/h/show-pwd.png);}" "QCheckBox::indicator:unchecked {image: url(:/res/h/hide-pwd.png);}"); diff --git a/wireless-security/dlgconnhidwifisectls.cpp b/wireless-security/dlgconnhidwifisectls.cpp index 0a7fb035..772d7abb 100644 --- a/wireless-security/dlgconnhidwifisectls.cpp +++ b/wireless-security/dlgconnhidwifisectls.cpp @@ -64,7 +64,8 @@ DlgConnHidWifiSecTls::DlgConnHidWifiSecTls(int type, QWidget *parent) : "QComboBox::drop-down{border:0;width:30px;}" "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"); ui->leCaPwd->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); - ui->checkBoxPwd->setStyleSheet("QCheckBox::indicator {width: 18px; height: 9px;}" + ui->checkBoxPwd->setStyleSheet("QCheckBox {border:none;background:transparent;}" + "QCheckBox::indicator {width: 18px; height: 9px;}" "QCheckBox::indicator:checked {image: url(:/res/h/show-pwd.png);}" "QCheckBox::indicator:unchecked {image: url(:/res/h/hide-pwd.png);}"); ui->checkBoxCA->setStyleSheet("QCheckBox{color:rgba(255,255,255,0.97);background-color:transparent;}"); @@ -76,7 +77,8 @@ DlgConnHidWifiSecTls::DlgConnHidWifiSecTls(int type, QWidget *parent) : "QComboBox::drop-down{border:0;width:30px;}" "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"); ui->leUserKeyPwd->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); - ui->checkBoxPwdSec->setStyleSheet("QCheckBox::indicator {width: 18px; height: 9px;}" + ui->checkBoxPwdSec->setStyleSheet("QCheckBox {border:none;background:transparent;}" + "QCheckBox::indicator {width: 18px; height: 9px;}" "QCheckBox::indicator:checked {image: url(:/res/h/show-pwd.png);}" "QCheckBox::indicator:unchecked {image: url(:/res/h/hide-pwd.png);}"); diff --git a/wireless-security/dlgconnhidwifisectls.ui b/wireless-security/dlgconnhidwifisectls.ui index d97d8d36..f1f91126 100644 --- a/wireless-security/dlgconnhidwifisectls.ui +++ b/wireless-security/dlgconnhidwifisectls.ui @@ -337,7 +337,7 @@ 357 577 18 - 8 + 9 diff --git a/wireless-security/dlgconnhidwifisectunneltls.cpp b/wireless-security/dlgconnhidwifisectunneltls.cpp index e49e78e3..2ac13177 100644 --- a/wireless-security/dlgconnhidwifisectunneltls.cpp +++ b/wireless-security/dlgconnhidwifisectunneltls.cpp @@ -64,7 +64,8 @@ DlgConnHidWifiSecTunnelTLS::DlgConnHidWifiSecTunnelTLS(int type, QWidget *parent "QComboBox::drop-down{border:0;width:30px;}" "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"); ui->leCaPwd->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); - ui->checkBoxPwd->setStyleSheet("QCheckBox::indicator {width: 18px; height: 9px;}" + ui->checkBoxPwd->setStyleSheet("QCheckBox {border:none;background:transparent;}" + "QCheckBox::indicator {width: 18px; height: 9px;}" "QCheckBox::indicator:checked {image: url(:/res/h/show-pwd.png);}" "QCheckBox::indicator:unchecked {image: url(:/res/h/hide-pwd.png);}"); ui->checkBoxCA->setStyleSheet("QCheckBox{color:rgba(255,255,255,0.97);background-color:transparent;}"); @@ -73,7 +74,8 @@ DlgConnHidWifiSecTunnelTLS::DlgConnHidWifiSecTunnelTLS(int type, QWidget *parent "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"); ui->leUserName->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); ui->lePassword->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); - ui->checkBoxPwdSec->setStyleSheet("QCheckBox::indicator {width: 18px; height: 9px;}" + ui->checkBoxPwdSec->setStyleSheet("QCheckBox {border:none;background:transparent;}" + "QCheckBox::indicator {width: 18px; height: 9px;}" "QCheckBox::indicator:checked {image: url(:/res/h/show-pwd.png);}" "QCheckBox::indicator:unchecked {image: url(:/res/h/hide-pwd.png);}"); diff --git a/wireless-security/dlgconnhidwifiwep.cpp b/wireless-security/dlgconnhidwifiwep.cpp index 0eb1f552..227f8fbf 100644 --- a/wireless-security/dlgconnhidwifiwep.cpp +++ b/wireless-security/dlgconnhidwifiwep.cpp @@ -47,7 +47,8 @@ DlgConnHidWifiWep::DlgConnHidWifiWep(int type, QWidget *parent) : "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"); ui->leNetName->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); ui->leKey->setStyleSheet("QLineEdit{color:rgba(255,255,255,0.97);background:rgba(255,255,255,0.08);}"); - ui->checkBoxPwd->setStyleSheet("QCheckBox::indicator {width: 18px; height: 9px;}" + ui->checkBoxPwd->setStyleSheet("QCheckBox {border:none;background:transparent;}" + "QCheckBox::indicator {width: 18px; height: 9px;}" "QCheckBox::indicator:checked {image: url(:/res/h/show-pwd.png);}" "QCheckBox::indicator:unchecked {image: url(:/res/h/hide-pwd.png);}"); ui->cbxSecurity->setStyleSheet("QComboBox{padding-left:20px;font-size:13px;color:rgba(255,255,255,1);border:1px solid rgba(255, 255, 255, 0.05);background:rgba(255,255,255,0.08);}" diff --git a/wireless-security/dlgconnhidwifiwpa.cpp b/wireless-security/dlgconnhidwifiwpa.cpp index 352870f5..ebe1ecf6 100644 --- a/wireless-security/dlgconnhidwifiwpa.cpp +++ b/wireless-security/dlgconnhidwifiwpa.cpp @@ -53,7 +53,8 @@ DlgConnHidWifiWpa::DlgConnHidWifiWpa(int type, MainWindow *mainWindow, QWidget * ui->cbxSecurity->setStyleSheet("QComboBox{padding-left:20px;font-size:13px;color:rgba(255,255,255,1);border:1px solid rgba(255, 255, 255, 0.05);background:rgba(255,255,255,0.08);}" "QComboBox::drop-down{border:0;width:30px;}" "QComboBox::down-arrow{image:url(:/res/g/down_arrow.png);}"); - ui->checkBoxPwd->setStyleSheet("QCheckBox::indicator {width: 18px; height: 9px;}" + ui->checkBoxPwd->setStyleSheet("QCheckBox {border:none;background:transparent;}" + "QCheckBox::indicator {width: 18px; height: 9px;}" "QCheckBox::indicator:checked {image: url(:/res/h/show-pwd.png);}" "QCheckBox::indicator:unchecked {image: url(:/res/h/hide-pwd.png);}"); @@ -66,6 +67,7 @@ DlgConnHidWifiWpa::DlgConnHidWifiWpa(int type, MainWindow *mainWindow, QWidget * ui->lineUp->setStyleSheet("background:rgba(255,255,255,0.08);"); ui->lineDown->setStyleSheet("background:rgba(255,255,255,0.08);"); ui->btnCancel->setFocusPolicy(Qt::NoFocus); + ui->checkBoxPwd->setFocusPolicy(Qt::NoFocus); ui->lbLeftupTitle->setText(tr("Add hidden Wi-Fi")); //加入隐藏Wi-Fi diff --git a/wireless-security/kylinheadfile.h b/wireless-security/kylinheadfile.h index b01bd536..041a1cc0 100644 --- a/wireless-security/kylinheadfile.h +++ b/wireless-security/kylinheadfile.h @@ -15,5 +15,6 @@ #include #include #include +#include #endif // KYLINHEADFILE_H