forked from qt-creator/qt-creator
RegistryAccess: Fix deprecation warning
warning C4996: 'QString::fromUtf16': Use char16_t* overload. Change-Id: I44d2dcb50bf45dc175230fb93e2b704a6b52e5b7 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -35,7 +35,7 @@ namespace RegistryAccess {
|
||||
static QString winErrorMessage(unsigned long error)
|
||||
{
|
||||
QString rc = QString::fromLatin1("#%1: ").arg(error);
|
||||
ushort *lpMsgBuf;
|
||||
char16_t *lpMsgBuf;
|
||||
|
||||
const int len = FormatMessage(
|
||||
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
@@ -90,7 +90,7 @@ bool registryReadStringKey(HKEY handle, // HKEY_LOCAL_MACHINE, etc.
|
||||
return false;
|
||||
data += '\0';
|
||||
data += '\0';
|
||||
*s = QString::fromUtf16(reinterpret_cast<const unsigned short*>(data.data()));
|
||||
*s = QString::fromUtf16(reinterpret_cast<const char16_t *>(data.data()));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ static const WCHAR *autoRegistryValueNameC = L"Auto";
|
||||
|
||||
static inline QString wCharToQString(const WCHAR *w)
|
||||
{
|
||||
return QString::fromUtf16(reinterpret_cast<const ushort *>(w));
|
||||
return QString::fromUtf16(reinterpret_cast<const char16_t *>(w));
|
||||
}
|
||||
|
||||
QString msgFunctionFailed(const char *f, unsigned long error);
|
||||
|
||||
Reference in New Issue
Block a user