Obsolete Members for QHash

以下成員源於類 QHash 被棄用。 提供它們是為使舊源代碼能繼續工作。強烈建議不要在新代碼中使用它們。

相關非成員

(deprecated in 6.6) int qGlobalQHashSeed ()
(deprecated in 6.6) void qSetGlobalQHashSeed (int newSeed )

相關非成員

[deprecated in 6.6] int qGlobalQHashSeed ()

This function is deprecated since 6.6. We strongly advise against using it in new code.

使用 QHashSeed::globalSeed () 代替。

Returns the current global QHash seed.

The seed is set in any newly created QHash 。見 qHash about how this seed is being used by QHash .

另請參閱 QHashSeed and QHashSeed::globalSeed ().

[deprecated in 6.6] void qSetGlobalQHashSeed ( int newSeed )

This function is deprecated since 6.6. We strongly advise against using it in new code.

使用 QHashSeed 代替。

Sets the global QHash seed to newSeed .

Manually setting the global QHash seed value should be done only for testing and debugging purposes, when deterministic and reproducible behavior on a QHash is needed. We discourage to do it in production code as it can make your application susceptible to algorithmic complexity attacks .

From Qt 5.10 and onwards, the only allowed values are 0 and -1. Passing the value -1 will reinitialize the global QHash seed to a random value, while the value of 0 is used to request a stable algorithm for C++ primitive types types (like int ) and string types ( QString , QByteArray ).

The seed is set in any newly created QHash 。見 qHash about how this seed is being used by QHash .

If the environment variable QT_HASH_SEED is set, calling this function will result in a no-op.

另請參閱 QHashSeed::globalSeed () 和 QHashSeed .