14#ifndef QT_BOOTSTRAPPED
22#if !defined(Q_OS_WIN) && QT_CONFIG(thread) && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_QNX) && \
23 defined(_POSIX_THREAD_SAFE_FUNCTIONS) && _POSIX_VERSION >= 200112L
46static QString windowsErrorString(
int errorCode)
49 wchar_t *
string =
nullptr;
50 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
53 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
58 LocalFree((HLOCAL)
string);
60 if (
ret.isEmpty() && errorCode == ERROR_MOD_NOT_FOUND)
62 if (
ret.endsWith(
"\r\n"_L1))
66 .
arg(
unsigned(errorCode), 8, 16,
'0'_L1);
73 const char *
s =
nullptr;
91 #if QT_CONFIG(thread) && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && _POSIX_VERSION >= 200112L && !defined(Q_OS_INTEGRITY) && !defined(Q_OS_QNX)
93 ret = fromstrerror_helper(strerror_r(errorCode,
buf.data(),
buf.size()),
buf);
100#ifndef QT_BOOTSTRAPPED
106 return ret.trimmed();
122 return u
"No error"_s;
132QString QSystemError::windowsString(
int errorCode)
139 const _com_error comError(hr);
141 if (
const wchar_t *msg = comError.ErrorMessage())
148 return windowsErrorString(code == -1 ? GetLastError() :
code);
static QString translate(const char *context, const char *key, const char *disambiguation=nullptr, int n=-1)
\threadsafe
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
static QString fromWCharArray(const wchar_t *string, qsizetype size=-1)
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static Q_CORE_EXPORT QString stdString(int errorCode=-1)
static Q_CORE_EXPORT QString string(ErrorScope errorScope, int errorCode)
Combined button and popup list for selecting options.
constexpr Initialization Uninitialized
GLenum GLuint GLenum GLsizei const GLchar * buf
QString qt_error_string(int code)
static QString standardLibraryErrorString(int errorCode)
#define QT_TRANSLATE_NOOP(scope, x)