diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-04-23 01:00:35 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-04-23 01:00:36 +0200 |
commit | 7f895553ace11d8afe5ae280e3c9a68264a6ea87 (patch) | |
tree | 8e0af6e7f95949fab8a711ebd04bc20977e2c730 /src/widgets/widgets/qdatetimeedit.cpp | |
parent | c6128fc67cda7f14432203b1ec7408a527053bdb (diff) | |
parent | e0a78bf4501c3102578d2de02c95418fa5bb4611 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Iaa439ba7dff19a17e3716b3d30f49f60fa6e38f8
Diffstat (limited to 'src/widgets/widgets/qdatetimeedit.cpp')
-rw-r--r-- | src/widgets/widgets/qdatetimeedit.cpp | 7 |
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)); |