5#include <QtCore/qvarlengtharray.h>
6#include <QtCore/qendian.h>
7#include <QtCore/qlist.h>
18 REGSAM permissions, REGSAM
access)
20 if (RegOpenKeyExW(parentHandle,
reinterpret_cast<const wchar_t *
>(subKey.utf16()),
21 0, permissions |
access, &m_key) != ERROR_SUCCESS) {
48 const auto subKeyC = subKey.isEmpty() ?
nullptr :
reinterpret_cast<const wchar_t *
>(subKey.utf16());
51 DWORD dataType = REG_NONE;
53 LONG
ret = RegQueryValueExW(m_key, subKeyC,
nullptr, &dataType,
nullptr, &
dataSize);
54 if (
ret != ERROR_SUCCESS)
58 if (dataType == REG_SZ || dataType == REG_EXPAND_SZ)
60 else if (dataType == REG_MULTI_SZ)
67 ret = RegQueryValueExW(m_key, subKeyC,
nullptr,
nullptr,
data.data(), &
dataSize);
68 if (
ret != ERROR_SUCCESS)
76 reinterpret_cast<const wchar_t *
>(
data.constData()));
87 reinterpret_cast<const wchar_t *
>(
data.constData()) +
i);
102 reinterpret_cast<const wchar_t *
>(
data.constData()),
data.size() / 2);
108 return qFromLittleEndian<quint32>(
data.constData());
110 case REG_DWORD_BIG_ENDIAN:
111 return qFromBigEndian<quint32>(
data.constData());
114 return qFromLittleEndian<quint64>(
data.constData());
125 return value<QString>(subKey).value_or(
QString());
130 const std::optional<DWORD>
val = value<DWORD>(subKey);
131 return {
val.value_or(0),
val.has_value()};
void append(parameter_type t)
\macro QT_RESTRICTED_CAST_FROM_ASCII
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
static QString fromWCharArray(const wchar_t *string, qsizetype size=-1)
qsizetype length() const noexcept
Returns the number of characters in this string.
QString stringValue(QStringView subKey) const
std::pair< DWORD, bool > dwordValue(QStringView subKey) const
QVariant value(QStringView subKey) const
Combined button and popup list for selecting options.
QList< QString > QStringList
Constructs a string list that contains the given string, str.
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data