qHash: Add seed argument for classes inheriting QString
Pre-requisite for a fix for qHash. The classes inherits from QString and after the upcoming fix their single-arg qHash overload is no longer preferred since we want to use a seed. This has been the case since Qt 5. Change-Id: I6e8601ab8d591742e2399d10521dec8cfa46f71a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit a6e8ee141d4f0fa9c19f689a279447c7e7252629) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
1cb57091ac
commit
5d5ab28eaf
@ -104,7 +104,10 @@ public:
|
|||||||
|
|
||||||
Q_DECLARE_TYPEINFO(QFileSystemWatcherPathKey, Q_RELOCATABLE_TYPE);
|
Q_DECLARE_TYPEINFO(QFileSystemWatcherPathKey, Q_RELOCATABLE_TYPE);
|
||||||
|
|
||||||
inline size_t qHash(const QFileSystemWatcherPathKey &key) { return qHash(key.toCaseFolded()); }
|
inline size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed = 0)
|
||||||
|
{
|
||||||
|
return qHash(key.toCaseFolded(), seed);
|
||||||
|
}
|
||||||
|
|
||||||
class QWindowsFileSystemWatcherEngineThread : public QThread
|
class QWindowsFileSystemWatcherEngineThread : public QThread
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,10 @@ public:
|
|||||||
|
|
||||||
Q_DECLARE_TYPEINFO(QFileSystemModelNodePathKey, Q_RELOCATABLE_TYPE);
|
Q_DECLARE_TYPEINFO(QFileSystemModelNodePathKey, Q_RELOCATABLE_TYPE);
|
||||||
|
|
||||||
inline size_t qHash(const QFileSystemModelNodePathKey &key) { return qHash(key.toCaseFolded()); }
|
inline size_t qHash(const QFileSystemModelNodePathKey &key, size_t seed = 0)
|
||||||
|
{
|
||||||
|
return qHash(key.toCaseFolded(), seed);
|
||||||
|
}
|
||||||
#else // Q_OS_WIN
|
#else // Q_OS_WIN
|
||||||
typedef QString QFileSystemModelNodePathKey;
|
typedef QString QFileSystemModelNodePathKey;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user