QtCore platform code: s/QPair/std::pair/
Also port qMakePair() to just braced initialization and CTAD. Task-number: QTBUG-115841 Change-Id: I46ee214ab47513375a6e28e3b439c7b060581235 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> (cherry picked from commit 87361727ffafbee460970cdb8e72056653fd2443) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
02eb5e6d30
commit
2d5a239285
@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
#include "qendian.h"
|
#include "qendian.h"
|
||||||
#include "qhash.h"
|
#include "qhash.h"
|
||||||
#include "qpair.h"
|
|
||||||
#include "qmutex.h"
|
#include "qmutex.h"
|
||||||
#include "qvarlengtharray.h"
|
#include "qvarlengtharray.h"
|
||||||
#include "private/qlocking_p.h"
|
#include "private/qlocking_p.h"
|
||||||
@ -715,7 +714,7 @@ QMacVersion::VersionTuple QMacVersion::versionsForImage(const mach_header *machH
|
|||||||
};
|
};
|
||||||
|
|
||||||
static auto makeVersionTuple = [](uint32_t dt, uint32_t sdk, QOperatingSystemVersion::OSType osType) {
|
static auto makeVersionTuple = [](uint32_t dt, uint32_t sdk, QOperatingSystemVersion::OSType osType) {
|
||||||
return qMakePair(
|
return std::pair(
|
||||||
QOperatingSystemVersion(osType, dt >> 16 & 0xffff, dt >> 8 & 0xff, dt & 0xff),
|
QOperatingSystemVersion(osType, dt >> 16 & 0xffff, dt >> 8 & 0xff, dt & 0xff),
|
||||||
QOperatingSystemVersion(osType, sdk >> 16 & 0xffff, sdk >> 8 & 0xff, sdk & 0xff)
|
QOperatingSystemVersion(osType, sdk >> 16 & 0xffff, sdk >> 8 & 0xff, sdk & 0xff)
|
||||||
);
|
);
|
||||||
|
@ -436,7 +436,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QMacVersion() = default;
|
QMacVersion() = default;
|
||||||
using VersionTuple = QPair<QOperatingSystemVersion, QOperatingSystemVersion>;
|
using VersionTuple = std::pair<QOperatingSystemVersion, QOperatingSystemVersion>;
|
||||||
static VersionTuple versionsForImage(const mach_header *machHeader);
|
static VersionTuple versionsForImage(const mach_header *machHeader);
|
||||||
static VersionTuple applicationVersion();
|
static VersionTuple applicationVersion();
|
||||||
static VersionTuple libraryVersion();
|
static VersionTuple libraryVersion();
|
||||||
|
@ -125,10 +125,10 @@ QString QWinRegistryKey::stringValue(QStringView subKey) const
|
|||||||
return value<QString>(subKey).value_or(QString());
|
return value<QString>(subKey).value_or(QString());
|
||||||
}
|
}
|
||||||
|
|
||||||
QPair<DWORD, bool> QWinRegistryKey::dwordValue(QStringView subKey) const
|
std::pair<DWORD, bool> QWinRegistryKey::dwordValue(QStringView subKey) const
|
||||||
{
|
{
|
||||||
const std::optional<DWORD> val = value<DWORD>(subKey);
|
const std::optional<DWORD> val = value<DWORD>(subKey);
|
||||||
return qMakePair(val.value_or(0), val.has_value());
|
return {val.value_or(0), val.has_value()};
|
||||||
}
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -58,7 +58,7 @@ public:
|
|||||||
|
|
||||||
// ### TODO: Remove once all usages are migrated to new interface.
|
// ### TODO: Remove once all usages are migrated to new interface.
|
||||||
QString stringValue(QStringView subKey) const;
|
QString stringValue(QStringView subKey) const;
|
||||||
QPair<DWORD, bool> dwordValue(QStringView subKey) const;
|
std::pair<DWORD, bool> dwordValue(QStringView subKey) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
HKEY m_key = nullptr;
|
HKEY m_key = nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user