From a14fadfb640103ecea76c3966cf23668bb7f448b Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 21 Sep 2015 15:53:49 +0200 Subject: Add getter and setter for qt_qhash_seed In some cases it's not possible to use QT_HASH_SEED, specially when we need to set the environment variable from inside the application, as dynamically loaded libraries or plugins may create static QHash instances. That would set qt_qhash_seed to a value different from -1 and skip the env var value. For those cases, and when we still want to set qt_qhash_seed, we provide a way to enforce its value. Auto-tests accessing qt_qhash_seed directly have been updated accordingly. Usage in qdoc, uic and rcc has been left as is for the time being. Change-Id: I3b35b4fa0223c83b1348a6508641905a2a63266f Reviewed-by: Lars Knoll --- src/corelib/tools/qhash.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/corelib/tools/qhash.h') diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index e367cc0068..8d65a018ae 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -1037,6 +1037,9 @@ Q_INLINE_TEMPLATE int QMultiHash::count(const Key &key, const T &value) return n; } +Q_CORE_EXPORT int qGlobalQHashSeed(); +Q_CORE_EXPORT void qSetGlobalQHashSeed(int newSeed); + Q_DECLARE_ASSOCIATIVE_ITERATOR(Hash) Q_DECLARE_MUTABLE_ASSOCIATIVE_ITERATOR(Hash) -- cgit v1.2.3