summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qdatetimeedit.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-04-23 01:00:35 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-04-23 01:00:36 +0200
commit7f895553ace11d8afe5ae280e3c9a68264a6ea87 (patch)
tree8e0af6e7f95949fab8a711ebd04bc20977e2c730 /src/widgets/widgets/qdatetimeedit.cpp
parentc6128fc67cda7f14432203b1ec7408a527053bdb (diff)
parente0a78bf4501c3102578d2de02c95418fa5bb4611 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'src/widgets/widgets/qdatetimeedit.cpp')
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp
index f1db87f414..aa19270af5 100644
--- a/src/widgets/widgets/qdatetimeedit.cpp
+++ b/src/widgets/widgets/qdatetimeedit.cpp
@@ -2000,7 +2000,14 @@ QDateTime QDateTimeEditPrivate::validateAndInterpret(QString &input, int &positi
return minimum.toDateTime();
}
}
+
StateNode tmp = parse(input, position, value.toDateTime(), fixup);
+ // Impose this widget's spec:
+ tmp.value = tmp.value.toTimeSpec(spec);
+ // ... but that might turn a valid datetime into an invalid one:
+ if (!tmp.value.isValid() && tmp.state == Acceptable)
+ tmp.state = Intermediate;
+
input = tmp.input;
position += tmp.padded;
state = QValidator::State(int(tmp.state));