summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-06-12 16:07:38 -0700
committerThiago Macieira <thiago.macieira@intel.com>2017-06-30 06:23:15 +0000
commiteebceec16b05439ded58abbbcb2420fe3dcb4c18 (patch)
tree43b1a7e59246526776f43d05729fa4d80930417f /examples
parent3038bec859895b1591b7035d4d397d45fce488bc (diff)
Use QRandomGenerator instead of q?rand
Change-Id: Icd0e0d4b27cb4e5eb892fffd14b5285d43f4afbf Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/wayland/minimal-cpp/window.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/wayland/minimal-cpp/window.cpp b/examples/wayland/minimal-cpp/window.cpp
index 68f206fcf..f0d0fd5d9 100644
--- a/examples/wayland/minimal-cpp/window.cpp
+++ b/examples/wayland/minimal-cpp/window.cpp
@@ -55,6 +55,7 @@
#include <QMatrix4x4>
#include <QOpenGLFunctions>
#include <QOpenGLTexture>
+#include <QRandomGenerator>
Window::Window()
: m_compositor(0)
@@ -74,7 +75,7 @@ static int sillyrandom(int range)
{
if (range <= 0)
range = 200;
- return qrand() % range;
+ return QRandomGenerator::bounded(range);
}
void Window::paintGL()
@@ -89,8 +90,6 @@ void Window::paintGL()
functions->glEnable(GL_BLEND);
functions->glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- qsrand(31337);
-
Q_FOREACH (View *view, m_compositor->views()) {
if (view->isCursor())
continue;