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