diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-06-12 16:03:04 -0700 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-07-04 11:45:30 +0000 |
commit | 096b9122b939de19836b75718156cc8155e84621 (patch) | |
tree | 248d30bd541891db42b5a70e775f561821c8d571 /examples/datavisualization/qmloscilloscope/datasource.cpp | |
parent | af03eef4ab3cc41a6148d1f73fef1193f4fc4dcb (diff) |
Use QRandomGenerator instead of q?rand
Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'examples/datavisualization/qmloscilloscope/datasource.cpp')
-rw-r--r-- | examples/datavisualization/qmloscilloscope/datasource.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/datavisualization/qmloscilloscope/datasource.cpp b/examples/datavisualization/qmloscilloscope/datasource.cpp index 4a9aaddb..cb82c672 100644 --- a/examples/datavisualization/qmloscilloscope/datasource.cpp +++ b/examples/datavisualization/qmloscilloscope/datasource.cpp @@ -29,6 +29,7 @@ #include "datasource.h" #include <QtCore/qmath.h> +#include <QtCore/qrandom.h> using namespace QtDataVisualization; @@ -95,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 - + (0.15f * float(qrand()) / float(RAND_MAX)) * yRangeMod; + + QRandomGenerator::bounded(0.15f) * yRangeMod; int index = k + cacheIndexAdjustment; if (index >= columnCount) { |