Skip to content

Commit 6157538

Browse files
committed
correct recording negative values
1 parent ad2c782 commit 6157538

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

omodsim/controls/numericlineedit.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ void NumericLineEdit::on_rangeChanged(const QVariant& bottom, const QVariant& to
441441
{
442442
const int nums = QString::number(top.toInt()).length();
443443
_paddingZeroWidth = qMax(1, nums);
444-
setMaxLength(qMax(1, nums));
444+
setMaxLength(qMax(2, nums + 1));
445445
setValidator(new QIntValidator(bottom.toInt(), top.toInt(), this));
446446

447447
}
@@ -475,7 +475,7 @@ void NumericLineEdit::on_rangeChanged(const QVariant& bottom, const QVariant& to
475475
{
476476
const int nums = QString::number(top.toLongLong()).length();
477477
_paddingZeroWidth = qMax(1, nums);
478-
setMaxLength(qMax(1, nums));
478+
setMaxLength(qMax(2, nums + 1));
479479
setValidator(new QInt64Validator(bottom.toLongLong(), top.toLongLong(), this));
480480
}
481481
break;

0 commit comments

Comments
 (0)