QSystemError: Make it format unknown Windows messages

Can happen if we're using HRESULT from weird facilities.

Change-Id: I3d10feaa2e5854ff3c01b32dbd068309e5131d1b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This commit is contained in:
Thiago Macieira 2017-07-07 13:16:25 -07:00
parent bf410ed529
commit f9bfc8b91c

View File

@ -103,6 +103,9 @@ static QString windowsErrorString(int errorCode)
ret = QString::fromLatin1("The specified module could not be found.");
if (ret.endsWith(QLatin1String("\r\n")))
ret.chop(2);
if (ret.isEmpty())
ret = QString::fromLatin1("Unknown error 0x%1.")
.arg(unsigned(errorCode), 8, 16, QLatin1Char('0'));
return ret;
}
#endif