Change return type of qHash with Qt 6 to size_t

This commit is contained in:
Jonas Kvinge
2020-11-17 01:22:38 +01:00
parent 4dcae4ce21
commit 042da74955
8 changed files with 33 additions and 1 deletions

View File

@@ -109,7 +109,11 @@ class MacOsDeviceLister : public DeviceLister {
static QSet<MTPDevice> sMTPDeviceList;
};
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
size_t qHash(const MacOsDeviceLister::MTPDevice& device);
#else
uint qHash(const MacOsDeviceLister::MTPDevice& device);
#endif
inline bool operator==(const MacOsDeviceLister::MTPDevice& a, const MacOsDeviceLister::MTPDevice& b) {
return (a.vendor_id == b.vendor_id) && (a.product_id == b.product_id);
}

View File

@@ -100,7 +100,11 @@ class ScopedIOObject {
QSet<MacOsDeviceLister::MTPDevice> MacOsDeviceLister::sMTPDeviceList;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
size_t qHash(const MacOsDeviceLister::MTPDevice& d) {
#else
uint qHash(const MacOsDeviceLister::MTPDevice& d) {
#endif
return qHash(d.vendor_id) ^ qHash(d.product_id);
}