summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2015-09-22 13:17:50 +0200
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2015-09-23 06:46:44 +0000
commitc619d2daac9b1f61e8ad2320b59c648b6af6af90 (patch)
tree208c5fc31f7888d81e1a7b62e6ee61c41b4caff0 /src/corelib
parentbe2e0f75ae2e55f235b34b402b70628a839b7782 (diff)
QDateTime: Ensure a valid timezone when using the "offset constructor".
The timeZone() function used to assert when called on such an object (or, for a release build, return an invalid time zone). Change-Id: I6ae8316b2ad76f1f868e2498f7ce8aa3fcabf4a6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qdatetime.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index eb4eff32b4..d6428920e5 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -3123,6 +3123,7 @@ QTimeZone QDateTime::timeZone() const
case Qt::UTC:
return QTimeZone::utc();
case Qt::OffsetFromUTC:
+ return QTimeZone(d->m_offsetFromUtc);
case Qt::TimeZone:
Q_ASSERT(d->m_timeZone.isValid());
return d->m_timeZone;