Details
-
Bug
-
Resolution: Invalid
-
P1: Critical
-
None
-
6.5.6, 6.7.2
Description
Issue :
When calling setDateTime() to set a time value to a QTimeEdit, the timeSpec is set as "UTC" regardless of the timeSpec of the received QDateTime.
In Qt 6.2, it was reflected from the QDateTime.
timeSpec can be updated afterwords, by calling setTimeSpec(Qt::LocalTime).
Steps to reproduce :
1. Run the attached example app with Qt 6.2 and Qt 6.5, respectively.
2. The debug messages in the Application Output will be as follows.
It shows, in Qt 6.5, QTimeEdit's timeSpec is set as "UTC" regardless of QDateTime's timeSpec.
Qt version : 6.2.12
----- before setTimeSpec(Qt::LocalTime) -----
QDateTime timeSpec : Qt::LocalTime
QTimeEdit timeSpec : Qt::LocalTime
QTimeEdit dateTime : QDateTime(2024-06-06 21:24:12.000 Tokyo Standard Time Qt::LocalTime)
----- after setTimeSpec(Qt::LocalTime) -----
QDateTime timeSpec : Qt::LocalTime
QTimeEdit timeSpec : Qt::LocalTime
QTimeEdit dateTime : QDateTime(2024-06-06 21:24:12.000 Tokyo Standard Time Qt::LocalTime)
Qt version : 6.5.6
----- before setTimeSpec(Qt::LocalTime) -----
QDateTime timeSpec : Qt::LocalTime
QTimeEdit timeSpec : Qt::UTC
QTimeEdit dateTime : QDateTime(2024-06-06 12:24:12.000 UTC Qt::UTC)
----- after setTimeSpec(Qt::LocalTime) -----
QDateTime timeSpec : Qt::LocalTime
QTimeEdit timeSpec : Qt::LocalTime
QTimeEdit dateTime : QDateTime(2024-06-06 21:24:12.000 Tokyo Standard Time Qt::LocalTime)
Side note :
The result from Qt 6.7.2 is as follows.
Qt version : 6.7.2
----- before setTimeSpec(Qt::LocalTime) -----
QDateTime timeSpec : Qt::LocalTime
QTimeEdit timeSpec : Qt::UTC
QTimeEdit dateTime : QDateTime(2024-06-06 12:24:12.000 UTC Qt::UTC)
----- after setTimeSpec(Qt::LocalTime) -----
QDateTime timeSpec : Qt::LocalTime
QTimeEdit timeSpec : Qt::LocalTime
QTimeEdit dateTime : QDateTime(2024-06-06 21:24:12.000 ?? (???) Qt::LocalTime)