diff options
Diffstat (limited to 'src/corelib/global/qglobal.h')
-rw-r--r-- | src/corelib/global/qglobal.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 64d9f79faf..9b8029990c 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -687,6 +687,15 @@ Q_CORE_EXPORT bool qSharedBuild() Q_DECL_NOTHROW; # define qUtf8Printable(string) QString(string).toUtf8().constData() #endif +/* + Wrap QString::utf16() with enough casts to allow passing it + to QString::asprintf("%ls") without warnings. +*/ +#ifndef qUtf16Printable +# define qUtf16Printable(string) \ + static_cast<const wchar_t*>(static_cast<const void*>(QString(string).utf16())) +#endif + class QString; Q_CORE_EXPORT QString qt_error_string(int errorCode = -1); |