summaryrefslogtreecommitdiffstats
path: root/doc/src/snippets/code/src_gui_image_qimagereader.cpp
diff options
context:
space:
mode:
authorJason McDonald <jason.mcdonald@nokia.com>2010-07-18 03:29:17 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2010-07-18 03:29:17 (GMT)
commitd8944b560a16db3805d6faadfaadbabe750c0cef (patch)
tree8f27e4b4d85307800e2a406482ab08a82775f239 /doc/src/snippets/code/src_gui_image_qimagereader.cpp
parent67eaa50ad5ae1543fd165ac6ce29accfcc428036 (diff)
downloadQt-d8944b560a16db3805d6faadfaadbabe750c0cef.zip
Qt-d8944b560a16db3805d6faadfaadbabe750c0cef.tar.gz
Qt-d8944b560a16db3805d6faadfaadbabe750c0cef.tar.bz2
QUUid::createUuid() should not generate identical sequences on UNIX
An unintended side-effect of commit 90a082c9076f35dcca092ade019891e92692710e is that if qrand() is used without being seeded first, then createUuid() would always generate the same sequence. This quite likely to happen considering the Qt does not actually seed the PRNG, but does use it in many places (we do not call qsrand(), but we do often call qrand()). Fix this by changing qrand() to calculate a seed, instead of defaulting to 1. This allows us to remove the qsrand() overload with no arguments, since qrand() will now seed automatically unless manually seeded by the programmer. Task-number: QTBUG-11213 Reviewed-by: thiago (manually cherry picked from commits 2ef8b92ececbf9d33d7c0b44f46c7c975fb0fdaa and a0fffeed6fceb8244328b649a3f6feb520493bc2) Conflicts: src/corelib/plugin/quuid.cpp
Diffstat (limited to 'doc/src/snippets/code/src_gui_image_qimagereader.cpp')
0 files changed, 0 insertions, 0 deletions