Merge branch 'jxj-01' into 'dbus-interface'

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

See merge request kylin-desktop/kylin-nm!464
This commit is contained in:
赵 世旭 2021-12-13 05:38:54 +00:00
commit 0ecb5e14bd
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 = new QLineEdit(m_pwdFrame);
m_pwdLineEdit->setAttribute(Qt::WA_InputMethodEnabled, false); 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); m_pwdLineEdit->installEventFilter(this);
connect(m_pwdLineEdit, &QLineEdit::textChanged, this, &WlanListItem::onPwdEditorTextChanged); connect(m_pwdLineEdit, &QLineEdit::textChanged, this, &WlanListItem::onPwdEditorTextChanged);
m_pwdLineEdit->setFixedHeight(PWD_AREA_HEIGHT); m_pwdLineEdit->setFixedHeight(PWD_AREA_HEIGHT);