summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.h
diff options
context:
space:
mode:
authorTakumi Asaki <asaki@sra.co.jp>2014-03-06 16:56:52 +0900
committerKai Koehne <kai.koehne@digia.com>2014-06-27 08:28:50 +0200
commit71c6fdf871d6a66c85a7618ec4ced25cf2bb9b5d (patch)
tree5f575e46627f2c9613c876401b1a363003338c92 /src/corelib/global/qglobal.h
parent7638c0d78310e1e6b979b1f734f2324afd598ddb (diff)
Introduce qUtf8Printable() macro to qglobal.h
This macro is equivalent to arg.toUtf8().constData(). It is usable for "%s" arguments of qDebug(), qWarning(), qFatal(), qCritical(). Change-Id: I2d9956e6651271e1e2183dce9c835511cf923bf3 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qglobal.h')
-rw-r--r--src/corelib/global/qglobal.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index a9621e744c..80c9992e25 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -645,6 +645,10 @@ inline void qUnused(T &x) { (void)x; }
# define qPrintable(string) QString(string).toLocal8Bit().constData()
#endif
+#ifndef qUtf8Printable
+# define qUtf8Printable(string) QString(string).toUtf8().constData()
+#endif
+
class QString;
Q_CORE_EXPORT QString qt_error_string(int errorCode = -1);