From cb496bf67050dd0a280ce9310caa0173018ea92b Mon Sep 17 00:00:00 2001 From: fensite Date: Fri, 18 Jun 2021 19:00:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?Fixed:=20The=20problem=20of=20being=20block?= =?UTF-8?q?ed=20in=20English=20mode=20of=20'Hide=20WLAN'=20=E8=A7=A3?= =?UTF-8?q?=E5=86=B3'=E5=8A=A0=E5=85=A5=E7=BD=91=E7=BB=9C'=E8=8B=B1?= =?UTF-8?q?=E6=96=87=E6=A8=A1=E5=BC=8F=E4=B8=8B=E6=96=87=E5=AD=97=E8=A2=AB?= =?UTF-8?q?=E9=81=AE=E6=8C=A1=E7=9A=84=E9=97=AE=E9=A2=98=20bug:61783?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 6bae7787..731d059e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -327,10 +327,11 @@ void MainWindow::createTopWifiUI() lbTopWifiList->show(); /*新建有线网按钮*/ btnAddNet = new QPushButton(topWifiListWidget); - btnAddNet->resize(W_BTN_FUN, H_BTN_FUN); btnAddNet->move(X_BTN_FUN, Y_BTN_FUN); btnAddNet->setText(tr("Hide WLAN"));//"加入网络" btnAddNet->setStyleSheet(funcBtnQss); + int textWith = QFontMetrics(btnAddNet->font()).width(btnAddNet->text()); + btnAddNet->resize(textWith > W_BTN_FUN ? textWith : W_BTN_FUN, H_BTN_FUN); btnAddNet->setFocusPolicy(Qt::NoFocus); btnAddNet->show(); connect(btnAddNet,SIGNAL(clicked()),this,SLOT(onBtnAddNetClicked())); From 78260f9a9240de91b7e22d71a5f42e8cee4e1cc9 Mon Sep 17 00:00:00 2001 From: Zhai Kangning Date: Fri, 18 Jun 2021 11:16:26 +0000 Subject: [PATCH 2/2] Update mainwindow.cpp --- src/mainwindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 731d059e..7a98e83c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -330,8 +330,8 @@ void MainWindow::createTopWifiUI() btnAddNet->move(X_BTN_FUN, Y_BTN_FUN); btnAddNet->setText(tr("Hide WLAN"));//"加入网络" btnAddNet->setStyleSheet(funcBtnQss); - int textWith = QFontMetrics(btnAddNet->font()).width(btnAddNet->text()); - btnAddNet->resize(textWith > W_BTN_FUN ? textWith : W_BTN_FUN, H_BTN_FUN); + int textWidth = QFontMetrics(btnAddNet->font()).width(btnAddNet->text()); + btnAddNet->resize(textWidth > W_BTN_FUN ? textWidth : W_BTN_FUN, H_BTN_FUN); btnAddNet->setFocusPolicy(Qt::NoFocus); btnAddNet->show(); connect(btnAddNet,SIGNAL(clicked()),this,SLOT(onBtnAddNetClicked()));