wifi密码输入框禁止中文的复制粘贴

This commit is contained in:
Jinxujie 2021-12-09 10:07:55 +08:00
parent 557a8acc8a
commit 21fb6ede7c
1 changed files with 6 additions and 0 deletions

View File

@ -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);