diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-06-12 15:28:13 -0700 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-08-23 04:47:59 +0000 |
commit | 2b7b24a0e039a18db8ab23475fbab44718f758a2 (patch) | |
tree | 0cfb916871a7e48d843dcd371d723a7d6083f2a6 /tests/auto/quick/shared | |
parent | 46ed14da325c6c0382c0bc54cacc347d2d7f2b0a (diff) |
Use QRandomGenerator instead of q?rand
Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto/quick/shared')
-rw-r--r-- | tests/auto/quick/shared/viewtestutil.cpp | 6 |
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..a33c5eae96 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::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::bounded(m_rowCount); beginInsertRows(QModelIndex(), rnum, rnum); m_rowCount++; endInsertRows(); |