diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2019-11-28 14:22:09 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2019-12-12 11:36:01 +0100 |
commit | 2a653fde48f7312ccd2f792d72d305061b410ae3 (patch) | |
tree | 398d018623b2649ce90be1fba6cbd141d92ddd8a /src/widgets/widgets/qdatetimeedit_p.h | |
parent | 5b193e3dd47704daf56c8817d0157f66363044c3 (diff) |
Convert date-time faithfully in QDateTimeEdit::setDateTime()
Previously, setDateTime() was documented to ignore the new date-time's
time-spec. It used the date and time (determined using that timespec)
with the QDateTimeEdit's configured spec. It is debatable whether that
really counts as ignoring its time-spec. All the same, that's what it
did. Fixing it is a behavior change. Added tests.
[ChangeLog][QtWidgets][QDateTimeEdit] QDateTimeEdit::setDateTime() now
converts the new datetime to the QDateTimeEdit's time-spec, rather
than combining its date and time (determined using the time spec it
came with) with the QDateTimeEdit's date and time.
Fixes: QTBUG-71181
Change-Id: Ibf0bd87723c3957ca00a2199d51d992032ef57ee
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Diffstat (limited to 'src/widgets/widgets/qdatetimeedit_p.h')
-rw-r--r-- | src/widgets/widgets/qdatetimeedit_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/widgets/qdatetimeedit_p.h b/src/widgets/widgets/qdatetimeedit_p.h index 392bb0c778..0a4433846f 100644 --- a/src/widgets/widgets/qdatetimeedit_p.h +++ b/src/widgets/widgets/qdatetimeedit_p.h @@ -109,6 +109,7 @@ public: void updateCache(const QVariant &val, const QString &str) const; + QDateTime convertTimeSpec(const QDateTime &datetime); void updateTimeSpec(); QString valueToText(const QVariant &var) const { return textFromValue(var); } |