summaryrefslogtreecommitdiffstats
path: root/examples/widgets/mainwindows/mainwindow/toolbar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/widgets/mainwindows/mainwindow/toolbar.cpp')
-rw-r--r--examples/widgets/mainwindows/mainwindow/toolbar.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/widgets/mainwindows/mainwindow/toolbar.cpp b/examples/widgets/mainwindows/mainwindow/toolbar.cpp
index 97152a64a3..814cfc7f4d 100644
--- a/examples/widgets/mainwindows/mainwindow/toolbar.cpp
+++ b/examples/widgets/mainwindows/mainwindow/toolbar.cpp
@@ -50,6 +50,8 @@
#include "toolbar.h"
+#include <QRandomGenerator>
+
#include <QMainWindow>
#include <QMenu>
#include <QPainter>
@@ -257,7 +259,7 @@ void ToolBar::randomize()
QList<QAction *> randomized;
QList<QAction *> actions = this->actions();
while (!actions.isEmpty()) {
- QAction *action = actions.takeAt(rand() % actions.size());
+ QAction *action = actions.takeAt(QRandomGenerator::global()->bounded(actions.size()));
randomized.append(action);
}
clear();