• 4969阅读
  • 3回复

怎么限制QLineEdit的输入呢? [复制链接]

上一主题 下一主题
离线yeyu
 
只看楼主 正序阅读 楼主  发表于: 2008-03-14
— 本帖被 XChinux 执行加亮操作(2008-03-14) —
我想只在QLineEdit里面输入0-9,另一种情况是只输入A-Z或者a-z,那么在QRegExp里面的该怎么写来表达阿?
离线jorneyr

只看该作者 3楼 发表于: 2008-03-23
引用第2楼yeyu于2008-03-21 12:17发表的  :
对于Qt 的正则表达式,我看得不大懂
这样写对不对阿?QRegExp rx("[A,Z][a,z]{1,1}");
QRegExp rx("[0,9]1,1}");


QRegExp rx("[A-Z][az]{1,2}");
离线yeyu
只看该作者 2楼 发表于: 2008-03-21
对于Qt 的正则表达式,我看得不大懂
这样写对不对阿?QRegExp rx("[A,Z][a,z]{1,1}");
QRegExp rx("[0,9]1,1}");
离线zncggaofei
只看该作者 1楼 发表于: 2008-03-14
看QLineEdit的文档  inputMask或setValidator
There is someone that is coming or passing away in your life around the clock, so you may lose sight of those seen, and forget those remembered. There is gain and loss in your life, so you may catch sight of those unseen, and remember those forgotten. Nevertheless, doesn’t the unseen exist for sure? Will the remembered remain forever?
快速回复
限100 字节
 
上一个 下一个