diff options
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r-- | src/corelib/global/qglobal.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index fe10c493a7..710f7e8ba1 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -743,7 +743,7 @@ Q_STATIC_ASSERT_X(UCHAR_MAX == 255, "Qt assumes that char is 8 bits"); \relates <QtGlobal> This enum describes the messages that can be sent to a message - handler (QtMsgHandler). You can use the enum to identify and + handler (QtMessageHandler). You can use the enum to identify and associate the various message types with the appropriate actions. @@ -2810,12 +2810,17 @@ int qrand() The char pointer will be invalid after the statement in which qPrintable() is used. This is because the array returned by - toLocal8Bit() will fall out of scope. + QString::toLocal8Bit() will fall out of scope. Example: \snippet code/src_corelib_global_qglobal.cpp 37 + \note qDebug(), qWarning(), qCritical(), qFatal() expect %s + arguments to be UTF-8 encoded, while qPrintable() converts to + local 8-bit encoding. Therefore using qPrintable for logging + strings is only safe if the argument contains only ASCII + characters. \sa qDebug(), qWarning(), qCritical(), qFatal() */ |