Drop support of Qt 5

Also remove usage of some deprecated stuff.

PR #19338.
This commit is contained in:
Vladimir Golovnev
2023-07-20 11:17:27 +03:00
committed by GitHub
parent 5e610cfdcf
commit dbe79484d2
55 changed files with 48 additions and 462 deletions

View File

@@ -376,17 +376,10 @@ Net::ServiceID Net::ServiceID::fromURL(const QUrl &url)
return {url.host(), url.port(80)};
}
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
std::size_t Net::qHash(const ServiceID &serviceID, const std::size_t seed)
{
return qHashMulti(seed, serviceID.hostName, serviceID.port);
}
#else
uint Net::qHash(const ServiceID &serviceID, const uint seed)
{
return ::qHash(serviceID.hostName, seed) ^ ::qHash(serviceID.port);
}
#endif
bool Net::operator==(const ServiceID &lhs, const ServiceID &rhs)
{

View File

@@ -54,11 +54,7 @@ namespace Net
static ServiceID fromURL(const QUrl &url);
};
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
std::size_t qHash(const ServiceID &serviceID, std::size_t seed = 0);
#else
uint qHash(const ServiceID &serviceID, uint seed = 0);
#endif
bool operator==(const ServiceID &lhs, const ServiceID &rhs);
enum class DownloadStatus

View File

@@ -484,7 +484,7 @@ QVariant GeoIPDatabase::readMapValue(quint32 &offset, const quint32 count) const
const QString key = field.toString();
field = readDataField(offset);
if (field.userType() == QVariant::Invalid)
if (field.userType() == QMetaType::UnknownType)
return {};
map[key] = field;
@@ -500,7 +500,7 @@ QVariant GeoIPDatabase::readArrayValue(quint32 &offset, const quint32 count) con
for (quint32 i = 0; i < count; ++i)
{
const QVariant field = readDataField(offset);
if (field.userType() == QVariant::Invalid)
if (field.userType() == QMetaType::UnknownType)
return {};
array.append(field);