Open stephensyn opened 4 years ago
What is your ask?
谢谢!
我是这样做的。感觉好像有点LOW。还有别的方法吗?
void ComplexPocess::on_lineEdit_Amount_textChanged(const QString &arg1) { ui->lineEdit_Amount->blockSignals(true); ui->lineEdit_Amount->setText(QString::number(arg1.toDouble(), 'f', 2)); ui->lineEdit_Amount->blockSignals(false); }
LineEdit 添加验证器,或者inputMask是比较好的方式
问题: LineEdit通过QDataWidgetMapper绑定了数据,希望显示的数据格式保留2位小数。比如500.00 ` dataMap = new QDataWidgetMapper; //给QDataWidgetMapper加载数据源 dataMap->setModel(repair_filter_model);