setValidator (new QDoubleValidator(0,100,2,ui->lineEdit)); 这种方法不管用。 正确的方法如下: QRegExp double_rx("100|([0-9]{0,2}[\.][0-9]{1,2})"); ...
確定! 回上一頁