PIVariantEdit for EvalSpinBox support precision and singleStep

This commit is contained in:
2023-04-20 20:21:05 +03:00
parent 2f630435bb
commit 54e192514f
2 changed files with 5 additions and 1 deletions

View File

@@ -136,6 +136,8 @@ PIVariantMap PIVariantEditors::NumberBase::attributes() const {
auto * w = qobject_cast<EvalSpinBox *>(widget);
if (w) {
ret[Attribute::expression] = Q2PIString(w->expression());
ret[Attribute::singleStep] = w->singleStep();
ret[Attribute::decimals] = w->precision();
}
} break;
case tScrollSpinBox: {
@@ -250,6 +252,8 @@ void PIVariantEditors::NumberBase::applyAttributes(const PIVariantMap & a) {
case tEvalSpinBox: {
auto * w = qobject_cast<EvalSpinBox *>(widget);
if (!w) return;
w->setSingleStep(step);
w->setPrecision(dec);
w->setExpression(PI2QString(a.value(Attribute::expression).toString()));
} break;
case tScrollSpinBox: {