From 14599af2f27292710e68a6e500aa9f9cf3a30789 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 21 Sep 2017 12:23:48 -0700 Subject: Update to new QRandomGenerator API To get latest qtbase dev integrated in qt5 dev again without qtdeclarative 5.10->dev merge. Change-Id: I6905649aca2b06302df8cee2f660f1f92398d36a Reviewed-by: Erik Verbruggen (cherry picked from commit ee00fa01dc41deaaedfa0d1d5cc6cd750bfe75f4) Reviewed-by: Lars Knoll --- examples/quick/scenegraph/sgengine/window.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples/quick/scenegraph/sgengine') diff --git a/examples/quick/scenegraph/sgengine/window.cpp b/examples/quick/scenegraph/sgengine/window.cpp index 7db91e3266..6f22510a81 100644 --- a/examples/quick/scenegraph/sgengine/window.cpp +++ b/examples/quick/scenegraph/sgengine/window.cpp @@ -72,9 +72,9 @@ public: transformNode->appendChildNode(textureNode); parentNode->appendChildNode(transformNode); - int duration = QRandomGenerator::getReal() * 400 + 800; - rotAnimation.setStartValue(QRandomGenerator::getReal() * 720 - 180); - rotAnimation.setEndValue(QRandomGenerator::getReal() * 720 - 180); + int duration = QRandomGenerator::global()->generateDouble() * 400 + 800; + rotAnimation.setStartValue(QRandomGenerator::global()->generateDouble() * 720 - 180); + rotAnimation.setEndValue(QRandomGenerator::global()->generateDouble() * 720 - 180); rotAnimation.setDuration(duration); rotAnimation.start(); @@ -182,8 +182,8 @@ void Window::addItems() QSGTexture *textures[] = { m_smileTexture.data(), m_qtTexture.data() }; for (int i = 0; i < 50; ++i) { QSGTexture *tex = textures[i%2]; - QPointF fromPos(-tex->textureSize().width(), QRandomGenerator::getReal() * (height() - tex->textureSize().height())); - QPointF toPos(width(), QRandomGenerator::getReal() * height() * 1.5 - height() * 0.25); + QPointF fromPos(-tex->textureSize().width(), QRandomGenerator::global()->generateDouble() * (height() - tex->textureSize().height())); + QPointF toPos(width(), QRandomGenerator::global()->generateDouble() * height() * 1.5 - height() * 0.25); m_items.append(QSharedPointer::create(m_sgRootNode.data(), tex, fromPos, toPos)); } update(); -- cgit v1.2.3