Showing the changes to interface/src/scripting/GooglePolyScriptingInterface.cpp (1 of 1 file). Show all
Unified · Split
| @@ -22,6 +22,7 @@ · 21 unmodified lines | ||
| 22 | 22 | #include <QString> |
| 23 | 23 | #include <QTime> |
| 24 | 24 | #include <QUrl> |
| 25 | +#include <QRandomGenerator> | |
| 25 | 26 | |
| 26 | 27 | #include "ScriptEngineLogging.h" |
| 27 | 28 | |
| @@ -102,9 +103,7 @@ QString GooglePolyScriptingInterface::getModelInfo(const QString& input) { · 74 unmodified lines | ||
| 102 | 103 | } |
| 103 | 104 | |
| 104 | 105 | int GooglePolyScriptingInterface::getRandIntInRange(int length) { |
| 105 | − QTime time = QTime::currentTime(); | |
| 106 | − qsrand((uint)time.msec()); | |
| 107 | − return qrand() % length; | |
| 106 | + return QRandomGenerator::global()->bounded(length); | |
| 108 | 107 | } |
| 109 | 108 | |
| 110 | 109 | QUrl GooglePolyScriptingInterface::formatURLQuery(const QString& keyword, const QString& category, const QString& format) { |