summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp
index 96a37197e9..98b0489dfc 100644
--- a/src/widgets/widgets/qdatetimeedit.cpp
+++ b/src/widgets/widgets/qdatetimeedit.cpp
@@ -2344,7 +2344,9 @@ void QDateTimeEditPrivate::interpret(EmitPolicy ep)
const QValidator::State state = q->validate(tmp, pos);
if (state != QValidator::Acceptable
&& correctionMode == QAbstractSpinBox::CorrectToPreviousValue
- && (state == QValidator::Invalid || !(fieldInfo(currentSectionIndex) & AllowPartial))) {
+ && (state == QValidator::Invalid
+ || currentSectionIndex < 0
+ || !(fieldInfo(currentSectionIndex) & AllowPartial))) {
setValue(value, ep);
updateTimeSpec();
} else {