diff options
author | Mitch Curtis <mitch.curtis@nokia.com> | 2012-08-16 15:55:31 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-21 11:05:20 +0200 |
commit | 718a2251be2d32f96befef1ec23912c1a2ce3e34 (patch) | |
tree | 8642ddb6f094fd873f20c6d45c6e9b507c3ef181 /src/widgets/doc/snippets/itemselection | |
parent | 17c89d157a0df2ed9fd0585c8ded21b04278ccf7 (diff) |
Serialise QDateTime as UTC and timeSpec() instead of private spec.
QDateTime currently serialises its private Spec enum. If a user was to
deserialise the individual components of a QDateTime separately, the
resulting timeSpec may be invalid when cast to the Qt::TimeSpec enum.
E.g.:
QDateTime dateTime(QDate(2012, 8, 14), QTime(8, 0, 0), Qt::UTC);
// ... serialise
// ... deserialise date, time, spec separately.
// spec == 2, the value of QDateTimePrivate::UTC.
// spec != UTC, will be set to LocalUnknown.
QDateTime deserialised(date, time, spec);
This patch serialises QDateTime objects in UTC and the value of
timeSpec() as opposed to QDateTimePrivate's spec. This changes the
serialisation behaviour of QDateTime for version 13 of QDataStream.
Task-number: QTBUG-4057
Change-Id: If650e7960dca7b6ab44b8233410a6369c41df73a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/widgets/doc/snippets/itemselection')
0 files changed, 0 insertions, 0 deletions