diff --git a/src/corelib/kernel/qwinregistry.cpp b/src/corelib/kernel/qwinregistry.cpp index 59d30fd4a35..cac5769e3b9 100644 --- a/src/corelib/kernel/qwinregistry.cpp +++ b/src/corelib/kernel/qwinregistry.cpp @@ -120,6 +120,10 @@ QVariant QWinRegistryKey::value(QStringView subKey) const return {}; } +// Returns the value of the specified subKey as a string, obtained using +// qvariant_cast from the underlying QVariant. If that value is not a string, +// or the subKey has no value, a string whose isNull() is true is returned. +// Otherwise, the resulting string (which may be empty) is returned. QString QWinRegistryKey::stringValue(QStringView subKey) const { return value(subKey).value_or(QString()); diff --git a/src/corelib/kernel/qwinregistry_p.h b/src/corelib/kernel/qwinregistry_p.h index e767e92f92a..8623ab1b1c6 100644 --- a/src/corelib/kernel/qwinregistry_p.h +++ b/src/corelib/kernel/qwinregistry_p.h @@ -56,7 +56,6 @@ public: return std::nullopt; } - // ### TODO: Remove once all usages are migrated to new interface. QString stringValue(QStringView subKey) const; private: