summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/datavisualization/draggableaxes/data.cpp12
-rw-r--r--examples/datavisualization/itemmodel/main.cpp2
-rw-r--r--examples/datavisualization/qmloscilloscope/datasource.cpp2
-rw-r--r--examples/datavisualization/scatter/scatterdatamodifier.cpp12
-rw-r--r--tests/manual/barstest/chart.cpp26
-rw-r--r--tests/manual/galaxy/galaxydata.cpp16
-rw-r--r--tests/manual/itemmodeltest/main.cpp4
-rw-r--r--tests/manual/qmlperf/datagenerator.cpp12
-rw-r--r--tests/manual/scattertest/scatterchart.cpp24
-rw-r--r--tests/manual/surfacetest/graphmodifier.cpp40
10 files changed, 75 insertions, 75 deletions
diff --git a/examples/datavisualization/draggableaxes/data.cpp b/examples/datavisualization/draggableaxes/data.cpp
index 67777cdc..f7f4a31e 100644
--- a/examples/datavisualization/draggableaxes/data.cpp
+++ b/examples/datavisualization/draggableaxes/data.cpp
@@ -166,10 +166,10 @@ void Data::addData()
QVector3D Data::randVector()
{
return QVector3D(
- (float)(QRandomGenerator::bounded(100)) / 2.0f -
- (float)(QRandomGenerator::bounded(100)) / 2.0f,
- (float)(QRandomGenerator::bounded(100)) / 2.0f -
- (float)(QRandomGenerator::bounded(100)) / 2.0f,
- (float)(QRandomGenerator::bounded(100)) / 2.0f -
- (float)(QRandomGenerator::bounded(100)) / 2.0f);
+ (float)(QRandomGenerator::global()->bounded(100)) / 2.0f -
+ (float)(QRandomGenerator::global()->bounded(100)) / 2.0f,
+ (float)(QRandomGenerator::global()->bounded(100)) / 2.0f -
+ (float)(QRandomGenerator::global()->bounded(100)) / 2.0f,
+ (float)(QRandomGenerator::global()->bounded(100)) / 2.0f -
+ (float)(QRandomGenerator::global()->bounded(100)) / 2.0f);
}
diff --git a/examples/datavisualization/itemmodel/main.cpp b/examples/datavisualization/itemmodel/main.cpp
index f8564578..782d9dd2 100644
--- a/examples/datavisualization/itemmodel/main.cpp
+++ b/examples/datavisualization/itemmodel/main.cpp
@@ -218,7 +218,7 @@ void GraphDataGenerator::addRow()
QModelIndex index = m_tableWidget->model()->index(0, i);
m_tableWidget->model()->setData(index,
((float)i / (float)m_columnCount) / 2.0f +
- (float)(QRandomGenerator::bounded(30)) / 100.0f);
+ (float)(QRandomGenerator::global()->bounded(30)) / 100.0f);
}
m_tableWidget->resizeColumnsToContents();
}
diff --git a/examples/datavisualization/qmloscilloscope/datasource.cpp b/examples/datavisualization/qmloscilloscope/datasource.cpp
index cb82c672..843eb3d6 100644
--- a/examples/datavisualization/qmloscilloscope/datasource.cpp
+++ b/examples/datavisualization/qmloscilloscope/datasource.cpp
@@ -96,7 +96,7 @@ void DataSource::generateData(int cacheCount, int rowCount, int columnCount,
float colWave = float(qSin((2.0 * M_PI * colMod) - (1.0 / 2.0 * M_PI)) + 1.0);
float y = (colWave * ((float(qSin(rowColWaveAngleMul * colMod) + 1.0))))
* rowColWaveMul
- + QRandomGenerator::bounded(0.15f) * yRangeMod;
+ + QRandomGenerator::global()->bounded(0.15f) * yRangeMod;
int index = k + cacheIndexAdjustment;
if (index >= columnCount) {
diff --git a/examples/datavisualization/scatter/scatterdatamodifier.cpp b/examples/datavisualization/scatter/scatterdatamodifier.cpp
index 025a6fa5..504645da 100644
--- a/examples/datavisualization/scatter/scatterdatamodifier.cpp
+++ b/examples/datavisualization/scatter/scatterdatamodifier.cpp
@@ -209,10 +209,10 @@ void ScatterDataModifier::toggleItemCount()
QVector3D ScatterDataModifier::randVector()
{
return QVector3D(
- (float)(QRandomGenerator::bounded(100)) / 2.0f -
- (float)(QRandomGenerator::bounded(100)) / 2.0f,
- (float)(QRandomGenerator::bounded(100)) / 100.0f -
- (float)(QRandomGenerator::bounded(100)) / 100.0f,
- (float)(QRandomGenerator::bounded(100)) / 2.0f -
- (float)(QRandomGenerator::bounded(100)) / 2.0f);
+ (float)(QRandomGenerator::global()->bounded(100)) / 2.0f -
+ (float)(QRandomGenerator::global()->bounded(100)) / 2.0f,
+ (float)(QRandomGenerator::global()->bounded(100)) / 100.0f -
+ (float)(QRandomGenerator::global()->bounded(100)) / 100.0f,
+ (float)(QRandomGenerator::global()->bounded(100)) / 2.0f -
+ (float)(QRandomGenerator::global()->bounded(100)) / 2.0f);
}
diff --git a/tests/manual/barstest/chart.cpp b/tests/manual/barstest/chart.cpp
index 21ef5eaa..528b32a5 100644
--- a/tests/manual/barstest/chart.cpp
+++ b/tests/manual/barstest/chart.cpp
@@ -380,10 +380,10 @@ void GraphModifier::createMassiveArray()
for (int j = 0; j < arrayDimension; j++) {
if (!m_negativeValuesOn)
(*dataRow)[j].setValue((float(i % 300 + 1) / 300.0)
- * QRandomGenerator::bounded(m_maxval));
+ * QRandomGenerator::global()->bounded(m_maxval));
else
(*dataRow)[j].setValue((float(i % 300 + 1) / 300.0)
- * QRandomGenerator::bounded(m_maxval) + m_minval);
+ * QRandomGenerator::global()->bounded(m_maxval) + m_minval);
}
dataArray->append(dataRow);
}
@@ -452,11 +452,11 @@ void GraphModifier::addRow()
for (float i = 0; i < m_columnCount; i++) {
if (!m_negativeValuesOn)
(*dataRow)[i].setValue(((i + 1) / (float)m_columnCount)
- * QRandomGenerator::bounded(m_maxval));
+ * QRandomGenerator::global()->bounded(m_maxval));
else
(*dataRow)[i].setValue(((i + 1) / (float)m_columnCount)
- * QRandomGenerator::bounded(m_maxval)
- - QRandomGenerator::bounded(m_minval));
+ * QRandomGenerator::global()->bounded(m_maxval)
+ - QRandomGenerator::global()->bounded(m_minval));
}
// TODO Needs to be changed to account for data window offset once it is implemented.
@@ -485,7 +485,7 @@ void GraphModifier::insertRow()
QBarDataRow *dataRow = new QBarDataRow(m_columnCount);
for (float i = 0; i < m_columnCount; i++)
(*dataRow)[i].setValue(((i + 1) / (float)m_columnCount)
- * QRandomGenerator::bounded(m_maxval) + m_minval);
+ * QRandomGenerator::global()->bounded(m_maxval) + m_minval);
// TODO Needs to be changed to account for data window offset once it is implemented.
int row = qMax(m_selectedBar.x(), 0);
@@ -519,7 +519,7 @@ void GraphModifier::changeItem()
int row = m_selectedBar.x();
int column = m_selectedBar.y();
if (row >= 0 && column >= 0) {
- QBarDataItem item(float(QRandomGenerator::bounded(100)));
+ QBarDataItem item(float(QRandomGenerator::global()->bounded(100)));
m_genericData->dataProxy()->setItem(row, column, item);
}
}
@@ -531,7 +531,7 @@ void GraphModifier::changeRow()
if (row >= 0) {
QBarDataRow *newRow = new QBarDataRow(m_genericData->dataProxy()->rowAt(row)->size());
for (int i = 0; i < newRow->size(); i++)
- (*newRow)[i].setValue(QRandomGenerator::bounded(m_maxval) + m_minval);
+ (*newRow)[i].setValue(QRandomGenerator::global()->bounded(m_maxval) + m_minval);
QString label = QStringLiteral("Change %1").arg(changeCounter++);
m_genericData->dataProxy()->setRow(row, newRow, label);
}
@@ -548,7 +548,7 @@ void GraphModifier::changeRows()
for (int i = startRow; i <= row; i++ ) {
QBarDataRow *newRow = new QBarDataRow(m_genericData->dataProxy()->rowAt(i)->size());
for (int j = 0; j < newRow->size(); j++)
- (*newRow)[j].setValue(QRandomGenerator::bounded(m_maxval) + m_minval);
+ (*newRow)[j].setValue(QRandomGenerator::global()->bounded(m_maxval) + m_minval);
newArray.append(newRow);
labels.append(QStringLiteral("Change %1").arg(changeCounter++));
}
@@ -1457,7 +1457,7 @@ void GraphModifier::insertRemoveTimerTimeout()
for (int k = 0; k < 1; k++) {
QBarDataRow *dataRow = new QBarDataRow(10);
for (float i = 0; i < 10; i++)
- (*dataRow)[i].setValue(((i + 1) / 10.0f) * (float)(QRandomGenerator::bounded(100)));
+ (*dataRow)[i].setValue(((i + 1) / 10.0f) * (float)(QRandomGenerator::global()->bounded(100)));
QString label = QStringLiteral("Insert %1").arg(insertCounter++);
m_dummyData->dataProxy()->insertRow(0, dataRow, label);
@@ -1471,7 +1471,7 @@ void GraphModifier::insertRemoveTimerTimeout()
for (int k = 0; k < 2; k++) {
QBarDataRow *dataRow = new QBarDataRow(10);
for (float i = 0; i < 10; i++)
- (*dataRow)[i].setValue(((i + 1) / 10.0f) * (float)(QRandomGenerator::bounded(100)));
+ (*dataRow)[i].setValue(((i + 1) / 10.0f) * (float)(QRandomGenerator::global()->bounded(100)));
QString label = QStringLiteral("Insert %1").arg(insertCounter++);
m_dummyData2->dataProxy()->insertRow(0, dataRow, label);
@@ -1774,7 +1774,7 @@ void GraphModifier::toggleCustomItem()
item->setMeshFile(":/shuttle.obj");
item->setPosition(positionOne);
item->setScaling(QVector3D(0.1f, 0.1f, 0.1f));
- item->setRotation(QQuaternion::fromAxisAndAngle(0.0f, 1.0f, 0.0f, QRandomGenerator::get32()));
+ item->setRotation(QQuaternion::fromAxisAndAngle(0.0f, 1.0f, 0.0f, QRandomGenerator::global()->generate()));
item->setTextureImage(QImage(":/shuttle.png"));
m_graph->addCustomItem(item);
} else {
@@ -1783,7 +1783,7 @@ void GraphModifier::toggleCustomItem()
item->setMeshFile(":/shuttle.obj");
item->setPosition(positionTwo);
item->setScaling(QVector3D(0.1f, 0.1f, 0.1f));
- item->setRotation(QQuaternion::fromAxisAndAngle(0.0f, 1.0f, 0.0f, QRandomGenerator::get32()));
+ item->setRotation(QQuaternion::fromAxisAndAngle(0.0f, 1.0f, 0.0f, QRandomGenerator::global()->generate()));
item->setTextureImage(QImage(":/shuttle.png"));
m_graph->addCustomItem(item);
}
diff --git a/tests/manual/galaxy/galaxydata.cpp b/tests/manual/galaxy/galaxydata.cpp
index dfd8db94..c49e07fd 100644
--- a/tests/manual/galaxy/galaxydata.cpp
+++ b/tests/manual/galaxy/galaxydata.cpp
@@ -163,12 +163,12 @@ void GalaxyData::createGalaxy()
1000.0); // Anzahl der st├╝tzstellen
for (int i = 3; i < numOfStars; ++i) {
- qreal rad = cd.valFromProp(QRandomGenerator::getReal());
+ qreal rad = cd.valFromProp(QRandomGenerator::global()->generateDouble());
m_pStars[i].m_a = rad;
m_pStars[i].m_b = rad * getExcentricity(rad);
m_pStars[i].m_angle = getAngularOffset(rad);
- m_pStars[i].m_theta = 360.0 * QRandomGenerator::getReal();
+ m_pStars[i].m_theta = 360.0 * QRandomGenerator::global()->generateDouble();
m_pStars[i].m_center = QVector2D(0.0f, 0.0f);
m_pStars[i].calcXY();
@@ -179,14 +179,14 @@ void GalaxyData::createGalaxy()
qreal x, y, rad;
for (int i = 0; i < numOfDust; ++i)
{
- x = 2.0 * m_radGalaxy * QRandomGenerator::getReal() - m_radGalaxy;
- y = 2.0 * m_radGalaxy * QRandomGenerator::getReal() - m_radGalaxy;
+ x = 2.0 * m_radGalaxy * QRandomGenerator::global()->generateDouble() - m_radGalaxy;
+ y = 2.0 * m_radGalaxy * QRandomGenerator::global()->generateDouble() - m_radGalaxy;
rad = sqrt(x*x + y*y);
m_pDust[i].m_a = rad;
m_pDust[i].m_b = rad * getExcentricity(rad);
m_pDust[i].m_angle = getAngularOffset(rad);
- m_pDust[i].m_theta = 360.0 * QRandomGenerator::getReal();
+ m_pDust[i].m_theta = 360.0 * QRandomGenerator::global()->generateDouble();
m_pDust[i].m_center = QVector2D(0.0f, 0.0f);
m_pDust[i].calcXY();
@@ -196,15 +196,15 @@ void GalaxyData::createGalaxy()
// Initialize H2
for (int i = 0; i < numOfH2; ++i)
{
- x = 2*(m_radGalaxy) * QRandomGenerator::getReal() - (m_radGalaxy);
- y = 2*(m_radGalaxy) * QRandomGenerator::getReal() - (m_radGalaxy);
+ x = 2*(m_radGalaxy) * QRandomGenerator::global()->generateDouble() - (m_radGalaxy);
+ y = 2*(m_radGalaxy) * QRandomGenerator::global()->generateDouble() - (m_radGalaxy);
rad = sqrt(x*x + y*y);
int k1 = 2*i;
m_pH2[k1].m_a = rad;
m_pH2[k1].m_b = rad * getExcentricity(rad);
m_pH2[k1].m_angle = getAngularOffset(rad);
- m_pH2[k1].m_theta = 360.0 * QRandomGenerator::getReal();
+ m_pH2[k1].m_theta = 360.0 * QRandomGenerator::global()->generateDouble();
m_pH2[k1].m_center = QVector2D(0.0f, 0.0f);
m_pH2[k1].calcXY();
diff --git a/tests/manual/itemmodeltest/main.cpp b/tests/manual/itemmodeltest/main.cpp
index 9ccf6ede..6cb97fc8 100644
--- a/tests/manual/itemmodeltest/main.cpp
+++ b/tests/manual/itemmodeltest/main.cpp
@@ -202,7 +202,7 @@ void GraphDataGenerator::addRow()
QModelIndex index = m_tableWidget->model()->index(0, i);
m_tableWidget->model()->setData(index,
((float)i / (float)m_columnCount) / 2.0f
- + QRandomGenerator::bounded(30.0 / 100.0f));
+ + QRandomGenerator::global()->bounded(30.0 / 100.0f));
}
m_tableWidget->resizeColumnsToContents();
}
@@ -235,7 +235,7 @@ void GraphDataGenerator::fixTableSize()
void GraphDataGenerator::changeSelectedButtonClicked()
{
// Change all selected cells to a random value 1-10
- QVariant value = QVariant::fromValue(QRandomGenerator::bounded(10.0) + 1);
+ QVariant value = QVariant::fromValue(QRandomGenerator::global()->bounded(10.0) + 1);
QList<QTableWidgetItem *> selectedItems = m_tableWidget->selectedItems();
foreach (QTableWidgetItem *item, selectedItems) {
QString oldData = item->data(Qt::DisplayRole).toString();
diff --git a/tests/manual/qmlperf/datagenerator.cpp b/tests/manual/qmlperf/datagenerator.cpp
index ec1b7ced..0d8cf9b2 100644
--- a/tests/manual/qmlperf/datagenerator.cpp
+++ b/tests/manual/qmlperf/datagenerator.cpp
@@ -60,9 +60,9 @@ void DataGenerator::generateData(QScatter3DSeries *series, uint count)
QScatterDataItem *ptrToDataArray = &dataArray->first();
for (uint i = 0; i < count; i++) {
- ptrToDataArray->setPosition(QVector3D(QRandomGenerator::getReal(),
- QRandomGenerator::getReal(),
- QRandomGenerator::getReal()));
+ ptrToDataArray->setPosition(QVector3D(QRandomGenerator::global()->generateDouble(),
+ QRandomGenerator::global()->generateDouble(),
+ QRandomGenerator::global()->generateDouble()));
ptrToDataArray++;
}
@@ -75,9 +75,9 @@ void DataGenerator::add(QScatter3DSeries *series, uint count)
appendArray.resize(count);
for (uint i = 0; i < count; i++) {
- appendArray[i].setPosition(QVector3D(QRandomGenerator::getReal(),
- QRandomGenerator::getReal(),
- QRandomGenerator::getReal()));
+ appendArray[i].setPosition(QVector3D(QRandomGenerator::global()->generateDouble(),
+ QRandomGenerator::global()->generateDouble(),
+ QRandomGenerator::global()->generateDouble()));
}
series->dataProxy()->addItems(appendArray);
diff --git a/tests/manual/scattertest/scatterchart.cpp b/tests/manual/scattertest/scatterchart.cpp
index e2f33309..c6775df2 100644
--- a/tests/manual/scattertest/scatterchart.cpp
+++ b/tests/manual/scattertest/scatterchart.cpp
@@ -120,7 +120,7 @@ void ScatterDataModifier::massiveDataTest()
m_massiveTestCacheArray.resize(cacheSize);
int totalIndex = 0;
for (int i = 0; i < unitCount && totalIndex < cacheSize; i++) {
- unitBase += direction * (QRandomGenerator::bounded(3) / 100.0f);
+ unitBase += direction * (QRandomGenerator::global()->bounded(3) / 100.0f);
if (unitBase > maxY) {
unitBase = maxY;
direction = -1.0f;
@@ -129,9 +129,9 @@ void ScatterDataModifier::massiveDataTest()
direction = 1.0f;
}
for (int j = 0; j < itemsPerUnit && totalIndex < cacheSize; j++) {
- float randFactor = float(QRandomGenerator::bounded(100)) / (100 / yRangeMargin);
+ float randFactor = float(QRandomGenerator::global()->bounded(100)) / (100 / yRangeMargin);
m_massiveTestCacheArray[totalIndex].setPosition(
- QVector3D(float(QRandomGenerator::bounded(itemsPerUnit)),
+ QVector3D(float(QRandomGenerator::global()->bounded(itemsPerUnit)),
unitBase + randFactor, 0.0f));
// Z value is irrelevant, we replace it anyway when we take item to use
totalIndex++;
@@ -781,8 +781,8 @@ void ScatterDataModifier::removeBunch()
void ScatterDataModifier::timeout()
{
- int doWhat = QRandomGenerator::bounded(10);
- if (!(QRandomGenerator::bounded(100)))
+ int doWhat = QRandomGenerator::global()->bounded(10);
+ if (!(QRandomGenerator::global()->bounded(100)))
doWhat = -1;
switch (doWhat) {
@@ -815,7 +815,7 @@ void ScatterDataModifier::timeout()
break;
case 9:
if (m_chart->seriesList().size())
- m_targetSeries = m_chart->seriesList().at(QRandomGenerator::bounded(m_chart->seriesList().size()));
+ m_targetSeries = m_chart->seriesList().at(QRandomGenerator::global()->bounded(m_chart->seriesList().size()));
else
addSeries();
break;
@@ -938,7 +938,7 @@ void ScatterDataModifier::toggleSeriesVisibility()
void ScatterDataModifier::changeSeriesName()
{
if (m_targetSeries)
- m_targetSeries->setName(m_targetSeries->name().append("-").append(QString::number(QRandomGenerator::bounded(10))));
+ m_targetSeries->setName(m_targetSeries->name().append("-").append(QString::number(QRandomGenerator::global()->bounded(10))));
}
void ScatterDataModifier::handleAxisXChanged(QValue3DAxis *axis)
@@ -1120,9 +1120,9 @@ void ScatterDataModifier::setHorizontalAspectRatio(int ratio)
QVector3D ScatterDataModifier::randVector()
{
QVector3D retvec = QVector3D(
- (float)(QRandomGenerator::bounded(100)) / 2.0f - (float)(QRandomGenerator::bounded(100)) / 2.0f,
- (float)(QRandomGenerator::bounded(100)) / 100.0f - (float)(QRandomGenerator::bounded(100)) / 100.0f,
- (float)(QRandomGenerator::bounded(100)) / 2.0f - (float)(QRandomGenerator::bounded(100)) / 2.0f);
+ (float)(QRandomGenerator::global()->bounded(100)) / 2.0f - (float)(QRandomGenerator::global()->bounded(100)) / 2.0f,
+ (float)(QRandomGenerator::global()->bounded(100)) / 100.0f - (float)(QRandomGenerator::global()->bounded(100)) / 100.0f,
+ (float)(QRandomGenerator::global()->bounded(100)) / 2.0f - (float)(QRandomGenerator::global()->bounded(100)) / 2.0f);
qDebug() << __FUNCTION__ << retvec;
@@ -1143,8 +1143,8 @@ QScatter3DSeries *ScatterDataModifier::createAndAddSeries()
series->setItemLabelFormat(QStringLiteral("@seriesName: (X:@xLabel / Z:@zLabel) Y:@yLabel"));
series->setMesh(QAbstract3DSeries::MeshSphere);
series->setMeshSmooth(true);
- series->setBaseColor(QColor(QRandomGenerator::bounded(256), QRandomGenerator::bounded(256), QRandomGenerator::bounded(256)));
- series->setItemSize(float(QRandomGenerator::bounded(90) + 10) / 100.0f);
+ series->setBaseColor(QColor(QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256)));
+ series->setItemSize(float(QRandomGenerator::global()->bounded(90) + 10) / 100.0f);
QObject::connect(series, &QScatter3DSeries::selectedItemChanged, this,
&ScatterDataModifier::handleSelectionChange);
diff --git a/tests/manual/surfacetest/graphmodifier.cpp b/tests/manual/surfacetest/graphmodifier.cpp
index 59ddfae8..11cabb4d 100644
--- a/tests/manual/surfacetest/graphmodifier.cpp
+++ b/tests/manual/surfacetest/graphmodifier.cpp
@@ -669,8 +669,8 @@ void GraphModifier::changeStyle()
void GraphModifier::selectButtonClicked()
{
QSurfaceDataProxy *proxy = m_theSeries->dataProxy();
- int row = QRandomGenerator::bounded(proxy->rowCount());
- int col = QRandomGenerator::bounded(proxy->columnCount());
+ int row = QRandomGenerator::global()->bounded(proxy->rowCount());
+ int col = QRandomGenerator::global()->bounded(proxy->columnCount());
m_theSeries->setSelectedPoint(QPoint(row, col));
}
@@ -701,11 +701,11 @@ void GraphModifier::timeout()
for (int i = 0; i < rows; i++) {
for (int j = 0; j < columns; j++) {
(*m_planeArray->at(i))[j].setX(m_planeArray->at(i)->at(j).x()
- * ((float((QRandomGenerator::bounded(10)) + 5.0f) / 10000.0f) + 0.999f));
+ * ((float((QRandomGenerator::global()->bounded(10)) + 5.0f) / 10000.0f) + 0.999f));
(*m_planeArray->at(i))[j].setY(m_planeArray->at(i)->at(j).y()
- * ((float((QRandomGenerator::bounded(10)) + 5.0f) / 1000.0f) + 0.99f) + 0.0001f);
+ * ((float((QRandomGenerator::global()->bounded(10)) + 5.0f) / 1000.0f) + 0.99f) + 0.0001f);
(*m_planeArray->at(i))[j].setZ(m_planeArray->at(i)->at(j).z()
- * ((float((QRandomGenerator::bounded(10)) + 5.0f) / 10000.0f) + 0.999f));
+ * ((float((QRandomGenerator::global()->bounded(10)) + 5.0f) / 10000.0f) + 0.999f));
}
}
@@ -894,7 +894,7 @@ void GraphModifier::changeRow()
float maxZ = 10.0f;
float stepX = (maxX - minX) / float(m_xCount - 1);
float stepZ = (maxZ - minZ) / float(m_zCount - 1);
- float i = float(QRandomGenerator::bounded(m_zCount));
+ float i = float(QRandomGenerator::global()->bounded(m_zCount));
QSurfaceDataRow *newRow = new QSurfaceDataRow(m_xCount);
float z = qMin(maxZ, (i * stepZ + minZ));
@@ -911,7 +911,7 @@ void GraphModifier::changeRow()
static int changeRowSeries = 0;
qDebug() << "Generating new values to a row at random pos for series " << changeRowSeries;
- int row = QRandomGenerator::bounded(m_zCount);
+ int row = QRandomGenerator::global()->bounded(m_zCount);
QSurfaceDataRow *newRow = createMultiRow(row, changeRowSeries, true);
if (m_ascendingZ)
m_multiseries[changeRowSeries]->dataProxy()->setRow(row, newRow);
@@ -985,7 +985,7 @@ void GraphModifier::changeRows()
float maxZ = 10.0f;
float stepX = (maxX - minX) / float(m_xCount - 1);
float stepZ = (maxZ - minZ) / float(m_zCount - 1);
- float start = float(QRandomGenerator::bounded(m_zCount - 3));
+ float start = float(QRandomGenerator::global()->bounded(m_zCount - 3));
QSurfaceDataArray dataArray;
@@ -1007,7 +1007,7 @@ void GraphModifier::changeRows()
static int changeRowSeries = 0;
qDebug() << "Generating new values for 3 rows at random pos for series " << changeRowSeries;
- int row = QRandomGenerator::bounded(m_zCount - 3);
+ int row = QRandomGenerator::global()->bounded(m_zCount - 3);
QSurfaceDataArray dataArray;
for (int i = 0; i < 3; i++) {
QSurfaceDataRow *newRow = createMultiRow(row + i, changeRowSeries, true);
@@ -1034,8 +1034,8 @@ void GraphModifier::changeItem()
float maxZ = 10.0f;
float stepX = (maxX - minX) / float(m_xCount - 1);
float stepZ = (maxZ - minZ) / float(m_zCount - 1);
- float i = float(QRandomGenerator::bounded(m_zCount));
- float j = float(QRandomGenerator::bounded(m_xCount));
+ float i = float(QRandomGenerator::global()->bounded(m_zCount));
+ float j = float(QRandomGenerator::global()->bounded(m_xCount));
float x = qMin(maxX, (j * stepX + minX));
float z = qMin(maxZ, (i * stepZ + minZ));
@@ -1048,8 +1048,8 @@ void GraphModifier::changeItem()
#ifdef MULTI_SERIES
static int changeItemSeries = 0;
int full = m_limitX * m_limitZ;
- float i = float(QRandomGenerator::bounded(m_zCount));
- float j = float(QRandomGenerator::bounded(m_xCount));
+ float i = float(QRandomGenerator::global()->bounded(m_zCount));
+ float j = float(QRandomGenerator::global()->bounded(m_xCount));
float x = float(j) - m_limitX + 0.5f + m_multiSampleOffsetX[changeItemSeries];
float z = float(i) - m_limitZ + 0.5f + m_multiSampleOffsetZ[changeItemSeries];
float angle = (z * x) / float(full) * 1.57f;
@@ -1291,10 +1291,10 @@ void GraphModifier::removeRow()
if (m_zCount < 1)
return;
- int row = QRandomGenerator::bounded(m_zCount);
+ int row = QRandomGenerator::global()->bounded(m_zCount);
#ifdef MULTI_SERIES
- int series = QRandomGenerator::bounded(4);
+ int series = QRandomGenerator::global()->bounded(4);
m_multiseries[series]->dataProxy()->removeRows(row, 1);
#else
m_theSeries->dataProxy()->removeRows(row, 1);
@@ -1307,7 +1307,7 @@ void GraphModifier::resetArray()
qDebug() << "Reset series data array";
int rows = 10;
int columns = 10;
- float randFactor = float(QRandomGenerator::bounded(100)) / 100.0f;
+ float randFactor = float(QRandomGenerator::global()->bounded(100)) / 100.0f;
QSurfaceDataArray *planeArray = new QSurfaceDataArray;
planeArray->reserve(rows);
@@ -1322,7 +1322,7 @@ void GraphModifier::resetArray()
}
#ifdef MULTI_SERIES
- int series = QRandomGenerator::bounded(4);
+ int series = QRandomGenerator::global()->bounded(4);
m_multiseries[series]->dataProxy()->resetArray(planeArray);
#else
m_theSeries->dataProxy()->resetArray(planeArray);
@@ -1333,7 +1333,7 @@ void GraphModifier::resetArrayEmpty()
{
QSurfaceDataArray *emptyArray = new QSurfaceDataArray;
#ifdef MULTI_SERIES
- int series = QRandomGenerator::bounded(4);
+ int series = QRandomGenerator::global()->bounded(4);
m_multiseries[series]->dataProxy()->resetArray(emptyArray);
#else
m_theSeries->dataProxy()->resetArray(emptyArray);
@@ -1364,7 +1364,7 @@ void GraphModifier::massiveDataTest()
for (int i = 0; i < cacheSize; i++) {
m_massiveTestCacheArray.append(new QSurfaceDataRow);
m_massiveTestCacheArray[i]->resize(columns);
- rowBase += direction * (float(QRandomGenerator::bounded(3)) / 100.0f);
+ rowBase += direction * (float(QRandomGenerator::global()->bounded(3)) / 100.0f);
if (rowBase > maxY) {
rowBase = maxY;
direction = -1.0f;
@@ -1373,7 +1373,7 @@ void GraphModifier::massiveDataTest()
direction = 1.0f;
}
for (int j = 0; j < columns; j++) {
- float randFactor = float(QRandomGenerator::bounded(100)) / (100 / yRangeMargin);
+ float randFactor = float(QRandomGenerator::global()->bounded(100)) / (100 / yRangeMargin);
(*m_massiveTestCacheArray.at(i))[j].setX(float(j));
(*m_massiveTestCacheArray.at(i))[j].setY(rowBase + randFactor);
// Z value is irrelevant, we replace it anyway when we take row to use