diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-04-27 17:02:17 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-04-28 19:11:09 +0200 |
commit | 768a6415b596e557cd84ffb56c3aa0e32645aa2f (patch) | |
tree | fc5bb705c823e6a70716c810a232feaae64dd3eb /tests/auto/qml/qqmlqt | |
parent | cdbce614b4b48327f3c51c69da0f862ab841d59a (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.
Pick-to: 6.1
Change-Id: If418bcfdb5e06f3e6a08ecc0ddb3ef4aa99706d4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlqt')
-rw-r--r-- | tests/auto/qml/qqmlqt/tst_qqmlqt.cpp | 11 |
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 4b0799004f..62e42072b0 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: |