summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r--src/corelib/tools/qstring.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 0bd2e6b23d..07ca62145b 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -7264,6 +7264,25 @@ QString QString::arg(const QString &a, int fieldWidth, QChar fillChar) const
difference if \a a1 contains e.g. \c{%1}:
\snippet qstring/main.cpp 13
+
+ A similar problem occurs when the numbered place markers are not
+ white space separated:
+
+ \snippet qstring/main.cpp 12
+ \snippet qstring/main.cpp 97
+
+ Let's look at the substitutions:
+ \list
+ \li First, \c Hello replaces \c {%1} so the string becomes \c {"Hello%3%2"}.
+ \li Then, \c 20 replaces \c {%2} so the string becomes \c {"Hello%320"}.
+ \li Since the maximum numbered place marker value is 99, \c 50 replaces \c {%32}.
+ \endlist
+ Thus the string finally becomes \c {"Hello500"}.
+
+ In such cases, the following yields the expected results:
+
+ \snippet qstring/main.cpp 12
+ \snippet qstring/main.cpp 98
*/
/*!