[LyX/master] Address Qt 6.7 deprecation warning
Juergen Spitzmueller
spitz at lyx.org
Sat Oct 19 08:04:15 UTC 2024
commit 4d51a05ce401bd1ad7c2bae5b6aeb7a2b494f35a
Author: Juergen Spitzmueller <spitz at lyx.org>
Date: Sat Oct 19 09:57:24 2024 +0200
Address Qt 6.7 deprecation warning
See https://doc.qt.io/qt-6.7/qdatetime-obsolete.html#setTimeSpec
---
src/support/lyxtime.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/support/lyxtime.cpp b/src/support/lyxtime.cpp
index 87e05d5947..daf3dcc9ac 100644
--- a/src/support/lyxtime.cpp
+++ b/src/support/lyxtime.cpp
@@ -19,6 +19,9 @@
#include <QDateTime>
#include <QLocale>
+#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0))
+#include <QTimeZone>
+#endif
using namespace std;
@@ -69,7 +72,11 @@ time_t from_asctime_utc(string t)
<< "´ (invalid format)");
return static_cast<time_t>(-1);
}
+#if (QT_VERSION >= QT_VERSION_CHECK(6, 7, 0))
+ loc_dt.setTimeZone(QTimeZone(QTimeZone::UTC));
+#else
loc_dt.setTimeSpec(Qt::UTC);
+#endif
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
return loc_dt.toSecsSinceEpoch();
#else
More information about the lyx-cvs
mailing list