QLatin1String: add qHash overload

It was never introduced in Qt 4, probably because of the implicit
conversion to QString (that is, adding the qHash overload for
QLatin1String in Qt 4 would have been a BIC).

Change-Id: I2ebc8e73a85be497866820e0ca416dd11167bb53
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
This commit is contained in:
Giuseppe D'Angelo 2012-03-25 08:18:15 +01:00 committed by Qt by Nokia
parent 2d89850b23
commit 538386f36f
2 changed files with 7 additions and 0 deletions

View File

@ -136,6 +136,11 @@ uint qHash(const QBitArray &bitArray, uint seed)
return result;
}
uint qHash(const QLatin1String &key, uint seed)
{
return hash(reinterpret_cast<const uchar *>(key.data()), key.size(), seed);
}
/*!
\internal
@ -618,6 +623,7 @@ void QHashData::checkSanity()
\fn uint qHash(const QBitArray &key, uint seed = 0)
\fn uint qHash(const QString &key, uint seed = 0)
\fn uint qHash(const QStringRef &key, uint seed = 0)
\fn uint qHash(const QLatin1String &key, uint seed = 0)
\relates QHash
\since 5.0

View File

@ -88,6 +88,7 @@ Q_CORE_EXPORT uint qHash(const QByteArray &key, uint seed = 0);
Q_CORE_EXPORT uint qHash(const QString &key, uint seed = 0);
Q_CORE_EXPORT uint qHash(const QStringRef &key, uint seed = 0);
Q_CORE_EXPORT uint qHash(const QBitArray &key, uint seed = 0);
Q_CORE_EXPORT uint qHash(const QLatin1String &key, uint seed = 0);
#if defined(Q_CC_MSVC)
#pragma warning( push )