[LyX/2.3.x] Deprecation fix backport

Juergen Spitzmueller spitz at lyx.org
Sat Mar 13 09:42:48 UTC 2021


commit 7922b761f52bb9d22425582cdf71b884041c9a83
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Mar 13 10:48:10 2021 +0100

    Deprecation fix backport
---
 src/frontends/qt4/GuiApplication.cpp |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp
index 29b708e..271e4c7 100644
--- a/src/frontends/qt4/GuiApplication.cpp
+++ b/src/frontends/qt4/GuiApplication.cpp
@@ -106,6 +106,9 @@
 #include <QObject>
 #include <QPixmap>
 #include <QPixmapCache>
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
+#include <QRandomGenerator>
+#endif
 #include <QRegExp>
 #include <QSessionManager>
 #include <QSettings>
@@ -1050,7 +1053,11 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
 	setDesktopFileName(lyx_package);
 #endif
 
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
+	QRandomGenerator(QDateTime::currentDateTime().toSecsSinceEpoch());
+#else
 	qsrand(QDateTime::currentDateTime().toTime_t());
+#endif
 
 	// Install translator for GUI elements.
 	installTranslator(&d->qt_trans_);


More information about the lyx-cvs mailing list