Address another deprecation warning.

One left to go.
This commit is contained in:
Juergen Spitzmueller 2021-03-12 10:10:33 +01:00
parent 1a35afbe8f
commit 26459a2cf5
2 changed files with 14 additions and 1 deletions

View File

@ -106,6 +106,9 @@
#include <QObject>
#include <QPainter>
#include <QPixmap>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
#include <QRandomGenerator>
#endif
#include <QRegExp>
#include <QSessionManager>
#include <QSettings>
@ -1085,8 +1088,11 @@ GuiApplication::GuiApplication(int & argc, char ** argv)
setDesktopFileName(lyx_package);
#endif
// FIXME Deprecated. Should use QRandomGenerator since 5.10
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
QRandomGenerator(QDateTime::currentDateTime().toTime_t());
#else
qsrand(QDateTime::currentDateTime().toTime_t());
#endif
// Install LyX translator for missing Qt translations
installTranslator(&d->gui_trans_);

View File

@ -16,6 +16,9 @@
#include <QCoreApplication>
#include <QDateTime>
#include <QTimer>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
#include <QRandomGenerator>
#endif
#include <string>
@ -38,7 +41,11 @@ public:
setOrganizationDomain("lyx.org");
setApplicationName(toqstr(app));
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
QRandomGenerator(QDateTime::currentDateTime().toTime_t());
#else
qsrand(QDateTime::currentDateTime().toTime_t());
#endif
}
int execute()
{