summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qdatetime.h4
-rw-r--r--src/corelib/tools/qlocale.cpp2
-rw-r--r--src/corelib/tools/qstring.cpp19
3 files changed, 22 insertions, 3 deletions
diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h
index a8372c1d57..c44f7f8fee 100644
--- a/src/corelib/tools/qdatetime.h
+++ b/src/corelib/tools/qdatetime.h
@@ -59,7 +59,7 @@ public:
StandaloneFormat
};
private:
- Q_DECL_CONSTEXPR QDate(qint64 julianDay) : jd(julianDay) {}
+ explicit Q_DECL_CONSTEXPR QDate(qint64 julianDay) : jd(julianDay) {}
public:
Q_DECL_CONSTEXPR QDate() : jd(nullJd()) {}
QDate(int y, int m, int d);
@@ -138,7 +138,7 @@ Q_DECLARE_TYPEINFO(QDate, Q_MOVABLE_TYPE);
class Q_CORE_EXPORT QTime
{
- Q_DECL_CONSTEXPR QTime(int ms) : mds(ms)
+ explicit Q_DECL_CONSTEXPR QTime(int ms) : mds(ms)
#if defined(Q_OS_WINCE)
, startTick(NullTime)
#endif
diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp
index e598e95bb6..703341cc36 100644
--- a/src/corelib/tools/qlocale.cpp
+++ b/src/corelib/tools/qlocale.cpp
@@ -3522,7 +3522,7 @@ QString QLocale::toCurrencyString(double value, const QString &symbol) const
\since 4.8
Returns an ordered list of locale names for translation purposes in
- preference order (like "en", "en-US", "en-Latn-US").
+ preference order (like "en-Latn-US", "en-US", "en").
The return value represents locale names that the user expects to see the
UI translation in.
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
*/
/*!