Doc: fix QRandomGenerator code snippets

Use the static global instance to call bounded() and fillRange().

Pick-To: 5.15
Change-Id: I91678b7c985ab9d0dcdf09aadad6cb8f495c02cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Tasuku Suzuki 2020-05-07 10:22:50 +09:00 committed by Thiago Macieira
parent fe4794f70e
commit 848b224df2

View File

@ -97,12 +97,12 @@
//! [9]
QVector<quint32> vector;
vector.resize(16);
QRandomGenerator::fillRange(vector.data(), vector.size());
QRandomGenerator::global()->fillRange(vector.data(), vector.size());
//! [9]
//! [10]
quint32 array[2];
QRandomGenerator::fillRange(array);
QRandomGenerator::global()->fillRange(array);
//! [10]
//! [11]
@ -115,11 +115,11 @@
//! [12]
//! [13]
quint32 v = QRandomGenerator::bounded(256);
quint32 v = QRandomGenerator::global()->bounded(256);
//! [13]
//! [14]
quint32 v = QRandomGenerator::bounded(1000, 2000);
quint32 v = QRandomGenerator::global()->bounded(1000, 2000);
//! [14]
//! [15]