Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
5.12, 5.13, 5.14, 5.15, 6.5
-
-
8
-
5da038ab5 (dev), 51cfc973b (dev), b39374440 (dev), 288599546 (6.8), d5d1ae883 (6.7)
-
Foundation Sprint 93
Description
QDateTimeEdit has a timeSpec property.
This can be set to Qt::UTC or Qt::LocalTime.
The relevant type also has values Qt::OffsetFromUTC, which needs an accompanying int offset (in seconds), and Qt::TimeZone, which needs an accompanying QTimeZone object.
One cannot set the timeSpec property to either of these, as doing so would invalidate all the date/time members (stored as QVariant so they can be QDate, QTime or QDateTime) of QDateTimeEdit (since it'd try to set their spec without supplying needed information).
(This may indicate that QDateTimeEdit is older than these Qt::TimeSpec values.)
This matches the old QDateTime::toTimeSpec() method, which has the same limitations; calls to it should be replaced by QDateTime's newer toUTC(), toLocalTime(), toOffsetFromUtc(offset) and toTimeZone(zone) methods. QDateTimeEdit could support similar methods to set its spec; however, setting a time-spec attribute is not a sensible option in general (though reading one is, in moderation).
Note that the timeSpec attribute is redundant with the time-spec of the date/time held as the QDateTimeEdit's current value.
In the long term, we need to kill the Qt::TimeSpec, as it's an anti-helpful abstraction.
Resolving this would require significant API changes to QDateTimeEdit (e.g. removal of the time-spec property, at least), so can only be done around a major version transition.
Attachments
Issue Links
- relates to
-
QTBUG-77948 Rewrite QDateTimeParser
- In Progress
-
QTBUG-72440 QDateTimeEdit and QTimeEdit range-ends can only cope with LocalTime and UTC
- Reported
-
QTBUG-71051 QDateTimeEdit should have more notifications for member changes
- Open
-
QTBUG-71181 QDateTimeEdit::setDateTime should take time specification into account
- Closed
- split to
-
QTBUG-118393 QDateTimeEdit cannot adapt to use a user-supplied time-zone
- Reported
For Gerrit Dashboard: QTBUG-80417 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
429369,25 | Port QDateTimeEdit internals to QTimeSystem | dev | qt/qtbase | Status: ABANDONED | +2 | 0 |
445269,14 | Port QDateTimeEdit internals to QTimeZone | dev | qt/qtbase | Status: MERGED | +2 | 0 |
502777,7 | Add a QDateTimeEdit::timeZone property | dev | qt/qtbase | Status: MERGED | +2 | 0 |
579650,4 | Qt Designer: Silence warning about unsupported properties of type QTimeZone | dev | qt/qttools | Status: MERGED | +2 | 0 |
580898,2 | Qt Designer: Silence warning about unsupported properties of type QTimeZone | 6.8 | qt/qttools | Status: MERGED | +2 | 0 |
581064,2 | Qt Designer: Silence warning about unsupported properties of type QTimeZone | 6.7 | qt/qttools | Status: MERGED | +2 | 0 |