QLineEdit *editor = new QLineEdit();
// 限制HEX格式: xx xx xx
QRegExp regExp("([a-fA-F0-9]{2})([\\s][a-fA-F0-9]{2})*[\\s]?");
editor->setValidator( new QRegExpValidator(regExp));
QLineEdit限制输入Hex格式
最新推荐文章于 2024-05-05 12:13:58 发布
QLineEdit *editor = new QLineEdit();
// 限制HEX格式: xx xx xx
QRegExp regExp("([a-fA-F0-9]{2})([\\s][a-fA-F0-9]{2})*[\\s]?");
editor->setValidator( new QRegExpValidator(regExp));