1.
bool OK;
double Val = QInputDialog::getDouble(this,QStringLiteral("title"),QStringLiteral("tip label"),tan,0,1.00,2,&OK);
if(!OK) return;
2.
QInputDialog input;
input.setStyleSheet("QPushButton{background-color:#48F048}");
input.setWindowIcon(QIcon("./img/img.bmp"));
input.setOkButtonText(QStringLiteral("确认"));
input.setCancelButtonText(QStringLiteral("取消"));
input.setInputMode(QInputDialog::DoubleInput);
input.setDoubleDecimals(2);
input.setDoubleMaximum(1.00);
input.setDoubleMinimum(0);
input.setWindowTitle(QStringLiteral("title"));
input.setLabelText(QStringLiteral("tip label"));
input.setDoubleValue(0.09);
if(input.exec() == QInputDialog::Accepted)
Val = input.doubleValue();
else
r