diff options
Diffstat (limited to 'examples/widgets/graphicsview/dragdroprobot/coloritem.cpp')
-rw-r--r-- | examples/widgets/graphicsview/dragdroprobot/coloritem.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/widgets/graphicsview/dragdroprobot/coloritem.cpp b/examples/widgets/graphicsview/dragdroprobot/coloritem.cpp index 64a715d31f..262e18a317 100644 --- a/examples/widgets/graphicsview/dragdroprobot/coloritem.cpp +++ b/examples/widgets/graphicsview/dragdroprobot/coloritem.cpp @@ -54,7 +54,7 @@ //! [0] ColorItem::ColorItem() - : color(qrand() % 256, qrand() % 256, qrand() % 256) + : color(QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256), QRandomGenerator::global()->bounded(256)) { setToolTip(QString("QColor(%1, %2, %3)\n%4") .arg(color.red()).arg(color.green()).arg(color.blue()) @@ -107,7 +107,7 @@ void ColorItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) //! [6] static int n = 0; - if (n++ > 2 && (qrand() % 3) == 0) { + if (n++ > 2 && QRandomGenerator::global()->bounded(3) == 0) { QImage image(":/images/head.png"); mime->setImageData(image); |