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>