qt 的正则表达式 的使用

来源:互联网 发布:opencv java 高斯模糊 编辑:程序博客网 时间:2024/06/05 08:51

//邮编:数字限制,最长允许输入10个数字


            QRegExp regExpCodeZip("[0-9]+$");


            ui.sCodeZipEdit->setValidator(new QRegExpValidator(regExpCodeZip,this));



//电话:字符串限制,最长允许输入20个字符,要考虑“-“,如:010-58592345的情况
            QRegExp regExpTel("[-0-9]+$");
            ui.sTelEdit->setValidator(new QRegExpValidator(regExpTel,this));

0 0
原创粉丝点击