diff options
Diffstat (limited to 'src/gui/widgets/qabstractspinbox.cpp')
-rw-r--r-- | src/gui/widgets/qabstractspinbox.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/widgets/qabstractspinbox.cpp b/src/gui/widgets/qabstractspinbox.cpp index a18af4f..c015589 100644 --- a/src/gui/widgets/qabstractspinbox.cpp +++ b/src/gui/widgets/qabstractspinbox.cpp @@ -1856,8 +1856,10 @@ QValidator::State QSpinBoxValidator::validate(QString &input, int &pos) const if (dptr->specialValueText.size() > 0 && input == dptr->specialValueText) return QValidator::Acceptable; - if (!dptr->prefix.isEmpty() && !input.startsWith(dptr->prefix)) + if (!dptr->prefix.isEmpty() && !input.startsWith(dptr->prefix)) { input.prepend(dptr->prefix); + pos += dptr->prefix.length(); + } if (!dptr->suffix.isEmpty() && !input.endsWith(dptr->suffix)) input.append(dptr->suffix); |