this->ui->lineEdit_Histogram_bin_count->setValidator(new QRegExpValidator(QRegExp("1*$")));//只能输入数字和"."
this->ui->lineEdit_Histogram_bin_count->setMaxLength(12);
this->ui->lineEdit_Max_iterations->setValidator(new QRegExpValidator(QRegExp("^[0-9]*$")));//只能输入数字
this->ui->lineEdit_Max_iterations->setMaxLength(12);
this->ui->lineEdit_Output_transform->setValidator(new QRegExpValidator(QRegExp("[a-zA-Z0-9_-]+$")));//只能输入数字和字母
this->ui->lineEdit_Output_transform->setMaxLength(32);
ui.m_PatientNameLineEdit->setValidator(new QRegExpValidator(QRegExp("[^\\/:<>?"|]+"), this));//不可输入/:<>?“字符
ui.m_PatientIDLineEdit->setValidator(new QRegExpValidator(QRegExp(”2+
"
)
,
t
h
i
s
)
)
;
/
/
只
可
输
入
大
小
写
字
母
和
0
到
9
数
字
u
i
.
m
P
h
o
n
e
N
u
m
b
e
r
L
i
n
e
E
d
i
t
−
>
s
e
t
V
a
l
i
d
a
t
o
r
(
n
e
w
Q
R
e
g
E
x
p
V
a
l
i
d
a
t
o
r
(
Q
R
e
g
E
x
p
(
"
[
0
−
9
−
+
]
+
"), this));//只可输入大小写字母和0到9数字 ui.m_PhoneNumberLineEdit->setValidator(new QRegExpValidator(QRegExp("^[0-9-+]+
"),this));//只可输入大小写字母和0到9数字ui.mPhoneNumberLineEdit−>setValidator(newQRegExpValidator(QRegExp("[0−9−+]+"), this));//只可输入0到9数字和+、-号
/设置QLineEdit可输入最大长度16/
ui.m_PatientIDLineEdit->setMaxLength(16);
/设置无菜单/
ui.m_PatientIDLineEdit->setContextMenuPolicy(Qt::NoContextMenu);