summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-03-23 11:41:53 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-03-23 20:24:58 +0100
commit34fe5f75bcfd382b3928e221b5c9a002545fe3b9 (patch)
treea72357b627c2f3025a937963b67bb9074ab116cb /src
parent3f744be923d209d9507962952df5e0e0c3744b02 (diff)
Deprecation warnings: replace qrand with QRandomGenerator
Change-Id: I80fe6f611b367c6c8a1b77e82dc791493f88929b Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/network/ssl/qsslsocket_qt.cpp3
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp4
-rw-r--r--src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp4
3 files changed, 8 insertions, 3 deletions
diff --git a/src/network/ssl/qsslsocket_qt.cpp b/src/network/ssl/qsslsocket_qt.cpp
index 9ff9a66c05..2f5d692162 100644
--- a/src/network/ssl/qsslsocket_qt.cpp
+++ b/src/network/ssl/qsslsocket_qt.cpp
@@ -39,6 +39,7 @@
#include <QtCore/qbytearray.h>
#include <QtCore/qdatastream.h>
#include <QtCore/qmessageauthenticationcode.h>
+#include <QtCore/qrandom.h>
#include "qsslsocket_p.h"
#include "qasn1element_p.h"
@@ -138,7 +139,7 @@ static QByteArray _q_PKCS12_salt()
QByteArray salt;
salt.resize(8);
for (int i = 0; i < salt.size(); ++i)
- salt[i] = (qrand() & 0xff);
+ salt[i] = (QRandomGenerator::global()->generate() & 0xff);
return salt;
}
diff --git a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp
index 82b6d60bcd..aa91d9266b 100644
--- a/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp
+++ b/src/plugins/platforms/xcb/nativepainting/qpaintengine_x11.cpp
@@ -37,6 +37,8 @@
**
****************************************************************************/
+#include <QtCore/qrandom.h>
+
#include <private/qpixmapcache_p.h>
#include <private/qpaintengine_p.h>
#include <private/qpolygonclipper_p.h>
@@ -504,7 +506,7 @@ static Picture getPatternFill(int screen, const QBrush &b)
return X11->pattern_fills[i].picture;
}
// none found, replace one
- int i = qrand() % 16;
+ int i = QRandomGenerator::global()->generate() % 16;
if (X11->pattern_fills[i].screen != screen && X11->pattern_fills[i].picture) {
XRenderFreePicture (QXcbX11Info::display(), X11->pattern_fills[i].picture);
diff --git a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp
index 57b1882e4b..6a483fc7e5 100644
--- a/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp
+++ b/src/plugins/platforms/xcb/nativepainting/qxcbnativepainting.cpp
@@ -37,6 +37,8 @@
**
****************************************************************************/
+#include <QtCore/qrandom.h>
+
#include "qxcbconnection.h"
#include "qcolormap_x11_p.h"
#include "qxcbnativepainting.h"
@@ -279,7 +281,7 @@ Picture QXcbX11Data::getSolidFill(int screen, const QColor &c)
return X11->solid_fills[i].picture;
}
// none found, replace one
- int i = qrand() % 16;
+ int i = QRandomGenerator::global()->generate() % 16;
if (X11->solid_fills[i].screen != screen && X11->solid_fills[i].picture) {
XRenderFreePicture (X11->display, X11->solid_fills[i].picture);