diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-09-21 12:23:48 -0700 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-11-03 09:12:14 +0000 |
commit | ee00fa01dc41deaaedfa0d1d5cc6cd750bfe75f4 (patch) | |
tree | e764c6bab1bd0883fcbfe20c7703f997fb22d510 /tests/auto/quick | |
parent | 62e23e1ae6542b5ab837a2481d9257c81e484013 (diff) |
Update to new QRandomGenerator API
Change-Id: I69f37f9304f24709a823fffd14e676c097712329
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'tests/auto/quick')
-rw-r--r-- | tests/auto/quick/qquicklistview/randomsortmodel.cpp | 4 | ||||
-rw-r--r-- | tests/auto/quick/shared/viewtestutil.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/auto/quick/qquicklistview/randomsortmodel.cpp b/tests/auto/quick/qquicklistview/randomsortmodel.cpp index 7c4bd5111c..7375fe0dbe 100644 --- a/tests/auto/quick/qquicklistview/randomsortmodel.cpp +++ b/tests/auto/quick/qquicklistview/randomsortmodel.cpp @@ -74,14 +74,14 @@ QVariant RandomSortModel::data(const QModelIndex& index, int role) const void RandomSortModel::randomize() { - const int row = QRandomGenerator::bounded(mData.count()); + const int row = QRandomGenerator::global()->bounded(mData.count()); int random; bool exists = false; // Make sure we won't end up with two items with the same weight, as that // would make unit-testing much harder do { exists = false; - random = QRandomGenerator::bounded(mData.count() * 10); + random = QRandomGenerator::global()->bounded(mData.count() * 10); QList<QPair<QString, int> >::ConstIterator iter, end; for (iter = mData.constBegin(), end = mData.constEnd(); iter != end; ++iter) { if ((*iter).second == random) { diff --git a/tests/auto/quick/shared/viewtestutil.cpp b/tests/auto/quick/shared/viewtestutil.cpp index a33c5eae96..d5bf0110c4 100644 --- a/tests/auto/quick/shared/viewtestutil.cpp +++ b/tests/auto/quick/shared/viewtestutil.cpp @@ -374,7 +374,7 @@ void QQuickViewTestUtil::StressTestModel::updateModel() { if (m_rowCount > 10) { for (int i = 0; i < 10; ++i) { - int rnum = QRandomGenerator::bounded(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 = QRandomGenerator::bounded(m_rowCount); + int rnum = QRandomGenerator::global()->bounded(m_rowCount); beginInsertRows(QModelIndex(), rnum, rnum); m_rowCount++; endInsertRows(); |