diff --git a/application/widgets/customcontrol/passwordinputdialog.cpp b/application/widgets/customcontrol/passwordinputdialog.cpp index 1b6cc74..a79b8d3 100644 --- a/application/widgets/customcontrol/passwordinputdialog.cpp +++ b/application/widgets/customcontrol/passwordinputdialog.cpp @@ -80,7 +80,7 @@ void PasswordInputDialog::initUi() // 限制中文和中文字符 #if QT_VERSION_MAJOR > 5 qDebug() << "QT_VERSION_MAJOR > 5, setting regular expression validator"; - QRegularExpression regExp("^[A-Za-z0-9`~!@#$%^&*()_-+=<>,.\\/ ]+$"); + QRegularExpression regExp("^[A-Za-z0-9`~!@#$%^&*()_+=<>,.\\/ -]+$"); QRegularExpressionValidator *regExpValidator = new QRegularExpressionValidator(regExp, this); #else qDebug() << "QT_VERSION_MAJOR <= 5, setting regular expression validator"; diff --git a/application/widgets/decryptdialog.cpp b/application/widgets/decryptdialog.cpp index fa4026a..4a28805 100644 --- a/application/widgets/decryptdialog.cpp +++ b/application/widgets/decryptdialog.cpp @@ -67,7 +67,7 @@ void DecryptDialog::initUi() // 限制中文和中文字符 #if QT_VERSION_MAJOR > 5 qDebug() << "[DecryptDialog] Using QRegularExpression for validator (QT_VERSION_MAJOR > 5)."; - QRegularExpression regExp("^[A-Za-z0-9`~!@#$%^&*()_-+=<>,.\\/ ]+$"); + QRegularExpression regExp("^[A-Za-z0-9`~!@#$%^&*()_+=<>,.\\/ -]+$"); QRegularExpressionValidator *regExpValidator = new QRegularExpressionValidator(regExp, this); #else qDebug() << "[DecryptDialog] Using QRegExp for validator (QT_VERSION_MAJOR <= 5).";