diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-11-10 11:39:35 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-11-10 11:39:35 +0100 |
commit | d7a5dc0cfdae2fb22b7061301575f04f2bcc3f1c (patch) | |
tree | 984a2638088671d2191fbd31e7076c756ab7dfb5 /src/corelib/tools/qstring.cpp | |
parent | 3d70925ee54d06e90bea392883d230b8ae2b1782 (diff) | |
parent | 73a1e8c60d894701f34806cc4b847aa2814bf389 (diff) |
Merge remote-tracking branch 'origin/5.3' into 5.4.0
Conflicts:
src/plugins/platforms/xcb/qxcbwindow.cpp
Change-Id: Iad9ef6bf7d6111efba8232a7d9b46bb9974912f5
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r-- | src/corelib/tools/qstring.cpp | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 48f251e3f4..71ca4239d0 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -5705,21 +5705,18 @@ QString QString::toUpper() const Safely builds a formatted string from the format string \a cformat and an arbitrary list of arguments. - The %lc escape sequence expects a unicode character of type ushort - (as returned by QChar::unicode()). The %ls escape sequence expects - a pointer to a zero-terminated array of unicode characters of type - ushort (as returned by QString::utf16()). - - \note This function expects a UTF-8 string for %s and Latin-1 for - the format string. - - The format string supports most of the conversion specifiers - provided by printf() in the standard C++ library. It doesn't - honor the length modifiers (e.g. \c h for \c short, \c ll for - \c{long long}). If you need those, use the standard snprintf() - function instead: - - \snippet qstring/main.cpp 63 + The format string supports the conversion specifiers, length modifiers, + and flags provided by printf() in the standard C++ library. The \a cformat + string and \c{%s} arguments must be UTF-8 encoded. + + \note The \c{%lc} escape sequence expects a unicode character of type + \c char16_t, or \c ushort (as returned by QChar::unicode()). + The \c{%ls} escape sequence expects a pointer to a zero-terminated array + of unicode characters of type \c char16_t, or ushort (as returned by + QString::utf16()). This is at odds with the printf() in the standard C++ + library, which defines \c {%lc} to print a wchar_t and \c{%ls} to print + a \c{wchar_t*}, and might also produce compiler warnings on platforms + where the size of \c {wchar_t} is not 16 bits. \warning We do not recommend using QString::sprintf() in new Qt code. Instead, consider using QTextStream or arg(), both of |