Replace deprecated qrand

This commit is contained in:
Dale Glass 2022-06-05 13:06:42 +02:00
parent a7f6fed937
commit 61cce5882e

View file

@ -22,6 +22,7 @@
#include <QString>
#include <QTime>
#include <QUrl>
#include <QRandomGenerator>
#include "ScriptEngineLogging.h"
@ -102,9 +103,7 @@ QString GooglePolyScriptingInterface::getModelInfo(const QString& input) {
}
int GooglePolyScriptingInterface::getRandIntInRange(int length) {
QTime time = QTime::currentTime();
qsrand((uint)time.msec());
return qrand() % length;
return QRandomGenerator::global()->bounded(length);
}
QUrl GooglePolyScriptingInterface::formatURLQuery(const QString& keyword, const QString& category, const QString& format) {