diff options
Diffstat (limited to 'src/corelib/io/qdebug.cpp')
-rw-r--r-- | src/corelib/io/qdebug.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index c1e0125cb1..9eed1f352a 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -148,6 +148,28 @@ QDebug::~QDebug() } /*! + \internal +*/ +void QDebug::putUcs4(uint ucs4) +{ + maybeQuote('\''); + if (ucs4 < 0x20) { + stream->ts << hex << "\\x" << ucs4 << reset; + } else if (ucs4 < 0x80) { + stream->ts << char(ucs4); + } else { + stream->ts << hex << qSetPadChar(QLatin1Char('0')); + if (ucs4 < 0x10000) + stream->ts << qSetFieldWidth(4) << "\\u"; + else + stream->ts << qSetFieldWidth(8) << "\\U"; + stream->ts << ucs4 << reset; + } + maybeQuote('\''); +} + + +/*! \fn QDebug::swap(QDebug &other) \since 5.0 |