[Development] QTimeScheme for Qt - 5.0 or 5.1?

Stephen Kelly stephen.kelly at kdab.com
Thu Jan 26 23:43:45 CET 2012

Hi there,

In looking at what it would take to add time zone support to Qt 5:


I'm following the python API which provides the same thing.

To investigate whether this could go into Qt 5.0 or not (ie, what is the 
impact on QDateTime), I started a patch:


In the patch I worked on the assumption that source compatibility does not 
matter. Of course it does, but it helps to see where compromise is needed.

Some of the API, eg 'void setUtcOffset(int seconds);' could be implemented by 
creating a new QTimeScheme properly configured with a UTC offset, but I took 
it out anyway rather than attempting to show a port in the patch.

It might also make sense to use QSharedPointer<QTimeScheme> in the APIs.

What I would mostly like to get feedback on though is the impact on the 
QDateTime API and behaviour, and how it is put through QDataStream etc. I'm 
not sure if there is any particular way (historical) timezone information 
should be transmitted over the wire (if at all). 

If it should not be handled at all in some cases of streaming a QDateTime, but 
it should be handled in others (which I think is the case - we don't want to 
lose this information in most cases), the to-be-streamed QDateTime would have 
to have its timezone information stripped in the former case.

That would be a source incompatible change if it happened in Qt 5.1. I'm also 
unsure about mapping cleanly from the Qt::TimeSpec enum to some class like 
QTimeScheme (I named it that instead of QTimeZone because utc offsets are not 
time zones). 

I think something like this abstraction should go into Qt 5.0, but I would 
like to get other opinions too. Do you think something like this can be added 
in 5.1 just as well?


Stephen Kelly <stephen.kelly at kdab.com> | Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120126/4c99fef9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3636 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120126/4c99fef9/attachment.bin>

More information about the Development mailing list