PIVariantEdit for EvalSpinBox support precision and singleStep
This commit is contained in:
@@ -4,7 +4,7 @@ cmake_policy(SET CMP0072 NEW) # FindOpenGL prefers GLVND by default
|
||||
project(QAD)
|
||||
set(QAD_MAJOR 2)
|
||||
set(QAD_MINOR 16)
|
||||
set(QAD_REVISION 0)
|
||||
set(QAD_REVISION 1)
|
||||
set(QAD_SUFFIX )
|
||||
set(QAD_COMPANY SHS)
|
||||
set(QAD_DOMAIN org.SHS)
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user