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 /examples/quick/scenegraph/graph | |
parent | 46ed14da325c6c0382c0bc54cacc347d2d7f2b0a (diff) |
Use QRandomGenerator instead of q?rand
Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'examples/quick/scenegraph/graph')
-rw-r--r-- | examples/quick/scenegraph/graph/noisynode.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/quick/scenegraph/graph/noisynode.cpp b/examples/quick/scenegraph/graph/noisynode.cpp index 834151599b..5658702f3a 100644 --- a/examples/quick/scenegraph/graph/noisynode.cpp +++ b/examples/quick/scenegraph/graph/noisynode.cpp @@ -40,6 +40,7 @@ #include "noisynode.h" +#include <QtCore/QRandomGenerator> #include <QtQuick/QSGSimpleMaterialShader> #include <QtQuick/QSGTexture> #include <QtQuick/QQuickWindow> @@ -103,7 +104,7 @@ NoisyNode::NoisyNode(QQuickWindow *window) QImage image(NOISE_SIZE, NOISE_SIZE, QImage::Format_RGB32); uint *data = (uint *) image.bits(); for (int i=0; i<NOISE_SIZE * NOISE_SIZE; ++i) { - uint g = rand() & 0xff; + uint g = QRandomGenerator::bounded(0xff); data[i] = 0xff000000 | (g << 16) | (g << 8) | g; } |