输入限制
This commit is contained in:
parent
c3d9dd085b
commit
11d0d3e9bb
|
@ -1031,7 +1031,8 @@ void DataBackup::initForthWidget()
|
||||||
editBackupName->setText(m_backupName);
|
editBackupName->setText(m_backupName);
|
||||||
}
|
}
|
||||||
// 支持输入中英文数字和部分字符
|
// 支持输入中英文数字和部分字符
|
||||||
QRegExp regx("^[\u4e00-\u9fa5a-zA-Z0-9~!@#$%^&*()-_+={}':;'\\[\\].<>/? ¥()——;《》‘’:“”、?]+$"); //其中匹配中文[\u4e00-\u9fa5]
|
// QRegExp regx("^[\u4e00-\u9fa5a-zA-Z0-9~!@#$%^&*()-_+={}':;'\\[\\].<>/? ¥()——;《》‘’:“”、?]+$"); //其中匹配中文[\u4e00-\u9fa5]
|
||||||
|
QRegExp regx("^[\u4e00-\u9fa5a-zA-Z0-9-@& +():'()——《》‘’:“”]*$");
|
||||||
QValidator *validator = new QRegExpValidator(regx);
|
QValidator *validator = new QRegExpValidator(regx);
|
||||||
editBackupName->setValidator(validator);
|
editBackupName->setValidator(validator);
|
||||||
// 备份名称错误提示
|
// 备份名称错误提示
|
||||||
|
|
|
@ -616,7 +616,8 @@ void SystemBackup::initForthWidget()
|
||||||
editBackupName->setMaxLength(100);
|
editBackupName->setMaxLength(100);
|
||||||
editBackupName->setPlaceholderText(QDateTime::currentDateTime().toString("yy-MM-dd hh:mm:ss"));
|
editBackupName->setPlaceholderText(QDateTime::currentDateTime().toString("yy-MM-dd hh:mm:ss"));
|
||||||
// 支持输入中英文数字和部分字符
|
// 支持输入中英文数字和部分字符
|
||||||
QRegExp regx("^[\u4e00-\u9fa5a-zA-Z0-9~!@#$%^&*()-_+={}':;'\\[\\].<>/? ¥()——;《》‘’:“”、?]+$"); //其中匹配中文[\u4e00-\u9fa5]
|
// QRegExp regx("^[\u4e00-\u9fa5a-zA-Z0-9~!@#$%^&*()-_+={}':;'\\[\\].<>/? ¥()——;《》‘’:“”、?]+$"); //其中匹配中文[\u4e00-\u9fa5]
|
||||||
|
QRegExp regx("^[\u4e00-\u9fa5a-zA-Z0-9-@& +():'()——《》‘’:“”]*$");
|
||||||
QValidator *validator = new QRegExpValidator(regx);
|
QValidator *validator = new QRegExpValidator(regx);
|
||||||
editBackupName->setValidator(validator);
|
editBackupName->setValidator(validator);
|
||||||
// 备份名称错误提示
|
// 备份名称错误提示
|
||||||
|
|
Loading…
Reference in New Issue