*/
static uint qt_create_qhash_seed()
{
+ QByteArray envSeed = qgetenv("QT_HASH_SEED");
+ if (!envSeed.isNull())
+ return envSeed.toUInt();
+
uint seed = 0;
#ifdef Q_OS_UNIX
process, and then passed by QHash as the second argument of the
two-arguments overload of the qHash() function.
+ This randomization of QHash is enabled by default. Even though programs
+ should never depend on a particular QHash ordering, there may be situations
+ where you temporarily need deterministic behavior, e.g. for debugging or
+ regression testing. To disable the randomization, define the environment
+ variable \c QT_HASH_SEED. The contents of that variable, interpreted as a
+ decimal value, will be used as the seed for qHash().
+
\sa QHashIterator, QMutableHashIterator, QMap, QSet
*/