aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/shared/viewtestutil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/shared/viewtestutil.cpp')
-rw-r--r--tests/auto/quick/shared/viewtestutil.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/quick/shared/viewtestutil.cpp b/tests/auto/quick/shared/viewtestutil.cpp
index cb2b8be97a..d5bf0110c4 100644
--- a/tests/auto/quick/shared/viewtestutil.cpp
+++ b/tests/auto/quick/shared/viewtestutil.cpp
@@ -28,6 +28,7 @@
#include "viewtestutil.h"
+#include <QtCore/QRandomGenerator>
#include <QtQuick/QQuickView>
#include <QtQuick/QQuickView>
#include <QtGui/QScreen>
@@ -356,7 +357,6 @@ QQuickViewTestUtil::StressTestModel::StressTestModel()
t->setInterval(500);
t->start();
- qsrand(qHash(QDateTime::currentDateTime()));
connect(t, &QTimer::timeout, this, &StressTestModel::updateModel);
}
@@ -374,7 +374,7 @@ void QQuickViewTestUtil::StressTestModel::updateModel()
{
if (m_rowCount > 10) {
for (int i = 0; i < 10; ++i) {
- int rnum = qrand() % m_rowCount;
+ int rnum = QRandomGenerator::global()->bounded(m_rowCount);
beginRemoveRows(QModelIndex(), rnum, rnum);
m_rowCount--;
endRemoveRows();
@@ -382,7 +382,7 @@ void QQuickViewTestUtil::StressTestModel::updateModel()
}
if (m_rowCount < 20) {
for (int i = 0; i < 10; ++i) {
- int rnum = qrand() % m_rowCount;
+ int rnum = QRandomGenerator::global()->bounded(m_rowCount);
beginInsertRows(QModelIndex(), rnum, rnum);
m_rowCount++;
endInsertRows();