diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-03-06 14:38:07 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-03-06 14:38:07 +0100 |
commit | 49a2ec05b43b49d06dba8c6909c9df8d308e127d (patch) | |
tree | 46d596c4c0e184aab0d4698f05247d1ed13c7e9a /src/corelib/tools/qdatetime.cpp | |
parent | b86106387350f673a20d3b0a2413023f6205169b (diff) | |
parent | 31c5b34e808db102bfc5364405711ec94fe51f0a (diff) |
Merge remote-tracking branch 'origin/stable' into dev
Conflicts:
src/plugins/platforms/qnx/qqnxscreen.cpp
src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
Change-Id: Ib64f21c077b54f2291d19187590bfe869b98477a
Diffstat (limited to 'src/corelib/tools/qdatetime.cpp')
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 83db1c3cc9..31c870b012 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -4045,6 +4045,16 @@ static void localToUtc(QDate &date, QTime &time, int isdst) _tzset(); #endif time_t secsSince1Jan1970UTC = mktime(&localTM); +#ifdef Q_OS_QNX + //mktime sometimes fails on QNX. Following workaround converts the date and time then manually + if (secsSince1Jan1970UTC == (time_t)-1) { + QDateTime tempTime = QDateTime(date, time, Qt::UTC);; + tempTime = tempTime.addMSecs(timezone * 1000); + date = tempTime.date(); + time = tempTime.time(); + return; + } +#endif #endif tm *brokenDown = 0; #if defined(Q_OS_WINCE) |