Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
5.11.1
-
None
-
-
2a653fde48f7312ccd2f792d72d305061b410ae3 (qt/qtbase/dev)
Description
When setting a QDateTime object to a QDateTimeEdit control the latter completely ignores the time spec of the argument (as documented). Here's the suspect code:
https://code.woboq.org/qt5/qtbase/src/widgets/widgets/qdatetimeedit.cpp.html#246
What any reasonable person would expect, however, is to have the date-time converted to the proper specification that was set to the edit, as this relates to the display only, not to the actual point in time. This all means that the following code:
QDateTimeEdit edit; edit.setDateTime(QDateTime::currentDateTimeUtc()); edit.setDateTime(QDateTime::currentDateTime());
produces different result for the two calls to QDateTimeEdit::setDateTime, which it should not as both arguments point to the same point in time.
Attachments
Issue Links
- relates to
-
QTBUG-80417 QDateTimeEdit cannot handle OffsetFromUTC or TimeZone as time-spec
- Closed
-
QTBUG-72440 QDateTimeEdit and QTimeEdit range-ends can only cope with LocalTime and UTC
- Reported
For Gerrit Dashboard: QTBUG-71181 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
283054,3 | Convert date-time faithfully in QDateTimeEdit::setDateTime() | dev | qt/qtbase | Status: MERGED | +2 | 0 |