From 21fb6ede7c1c4feb58545f938c59323f3e458a68 Mon Sep 17 00:00:00 2001 From: Jinxujie Date: Thu, 9 Dec 2021 10:07:55 +0800 Subject: [PATCH] =?UTF-8?q?wifi=E5=AF=86=E7=A0=81=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E6=A1=86=E7=A6=81=E6=AD=A2=E4=B8=AD=E6=96=87=E7=9A=84=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E7=B2=98=E8=B4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/list-items/wlanlistitem.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/frontend/list-items/wlanlistitem.cpp b/src/frontend/list-items/wlanlistitem.cpp index 6b0526c0..abab6661 100644 --- a/src/frontend/list-items/wlanlistitem.cpp +++ b/src/frontend/list-items/wlanlistitem.cpp @@ -232,6 +232,12 @@ void WlanListItem::initWlanUI() m_pwdLineEdit = new QLineEdit(m_pwdFrame); m_pwdLineEdit->setAttribute(Qt::WA_InputMethodEnabled, false); + m_pwdLineEdit->setContextMenuPolicy(Qt::NoContextMenu); + + QRegExp rx("^[A-Za-z0-9`~!@#$%^&*()_-+=<>,.\\\/]+$"); + QRegExpValidator *latitude = new QRegExpValidator(rx, this); + m_pwdLineEdit->setValidator(latitude); + m_pwdLineEdit->installEventFilter(this); connect(m_pwdLineEdit, &QLineEdit::textChanged, this, &WlanListItem::onPwdEditorTextChanged); m_pwdLineEdit->setFixedHeight(PWD_AREA_HEIGHT);