summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-04-27 17:02:17 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-04-29 18:16:42 +0000
commitc7524d8fbf6e73c477d6c9156a1c96b482ba65e5 (patch)
treea1f8d86ff0685e521aab3dbc73e23f3ccbca92c6
parent3b9064ae568d55d2dd8d31f11b481396f49c4ce1 (diff)
Fix MSVC complaint about deprecated posix API
MSVC wants ISO C++ _tzset instead of posix tzset, but we have qTzSet as a wrapper that also synchronizes with the environment mutex. The test already depends on Qt::CorePrivate, so no problem to include the qglobal_p.h private header. Remove the now unnecessary Windows specific includes. Change-Id: If418bcfdb5e06f3e6a08ecc0ddb3ef4aa99706d4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 768a6415b596e557cd84ffb56c3aa0e32645aa2f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--tests/auto/qml/qqmlqt/tst_qqmlqt.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
index e4f28c29fb..b1238393bb 100644
--- a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
+++ b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp
@@ -45,12 +45,7 @@
#include <QMatrix4x4>
#include <QFont>
#include "../../shared/util.h"
-
-// Copied from tst_qdatetime.cpp
-#ifdef Q_OS_WIN
-# include <qt_windows.h>
-# include <time.h>
-#endif
+#include <private/qglobal_p.h>
class tst_qqmlqt : public QQmlDataTest
{
@@ -1369,7 +1364,7 @@ public:
oldZone = qgetenv("TZ");
}
qputenv("TZ", newZone);
- tzset();
+ qTzSet();
}
~TimeZoneSwitch()
@@ -1381,7 +1376,7 @@ public:
qputenv("TZ", oldZone);
else
qunsetenv("TZ");
- tzset();
+ qTzSet();
}
private: