From b9c8073230dfd90962188a24f78d4f4157f9eaad Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 2 Dec 2013 13:08:37 +0100 Subject: QSpinBox: allow positive values to be entered with the '+' prefix. The code was there to do it, but it was using minimumValue instead of maximumValue to test if the '+' should be allowed. Task-number: QTBUG-20691 [ChangeLog][QtWidgets][QSpinBox] Entering positive values with the '+' prefix is now allowed. Change-Id: Iff62d073e350dc9a33b7e06e4b492048c74437c4 Reviewed-by: Marc Mutz --- src/widgets/widgets/qspinbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp index bf4e130d4e..2a34451408 100644 --- a/src/widgets/widgets/qspinbox.cpp +++ b/src/widgets/widgets/qspinbox.cpp @@ -1040,7 +1040,7 @@ QVariant QSpinBoxPrivate::validateAndInterpret(QString &input, int &pos, if (max != min && (copy.isEmpty() || (min < 0 && copy == QLatin1String("-")) - || (min >= 0 && copy == QLatin1String("+")))) { + || (max >= 0 && copy == QLatin1String("+")))) { state = QValidator::Intermediate; QSBDEBUG() << __FILE__ << __LINE__<< "num is set to" << num; } else if (copy.startsWith(QLatin1Char('-')) && min >= 0) { -- cgit v1.2.3