[Qt-interest] New Date and Time Features in Qt5?

Till Oliver Knoll till.oliver.knoll at gmail.com
Mon May 30 22:32:28 CEST 2011



Am 29.05.2011 um 06:31 schrieb hugh <hdixon at bigpond.net.au>:

> I work across a couple of time zones, and it would be nice ***in terms of the 
> widgets***  if when entering or viewing a time/date I can set which time zone 
> applies to that

I do understand your use case, but solving that problem in the View would be IMHO wrong.

Time zone information must be handled in the Model - e.g. QDateTime (?) - and handling the local time zone is business logic which doesn't belong into any QWidget.

For instance the "Server" calculates everything in Greenich Mean Time and your presentation logic - not the View/Widgets - would convert from/to the local time on the Client side.

Widgets should be plain and "stupid" and just display what the underlying model tells them to display (or process raw user input and notify the Model).

Cheers, Oliver


More information about the Qt-interest-old mailing list