summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstring.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2025-07-15 22:36:03 +0200
committerMarc Mutz <marc.mutz@qt.io>2025-07-17 11:55:56 +0200
commitd43337e7f39d55d84a59d1b54fc28a10da8ff1a7 (patch)
treef951a236f75908c1e7e06e3a713a62491f8c6306 /src/corelib/text/qstring.cpp
parent84263b5cfedfa849a08c974b3564143fd26a3f4e (diff)
[docs] QString: arg(FP-ish) no longer accepts implicit conversions
This was the whole point of making the arg() overloads templates, but we didn't document it well enough, contributng to QTBUG-138471 This patch fixes this. Amends 563ed822f867c6c3040956017d4ca7f3795f172c. Task-number: QTBUG-138471 Pick-to: 6.10 6.9 Change-Id: I95e6866ca1a98d6191bc71a8a6ed88b81dc70192 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r--src/corelib/text/qstring.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index 9d0631f832d..d506662fba7 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -8968,7 +8968,10 @@ QString QString::arg_impl(qulonglong a, int fieldWidth, int base, QChar fillChar
\snippet code/src_corelib_text_qstring.cpp 2
\note In Qt versions prior to 6.9, this function was a regular function
- taking \c double.
+ taking \c double. As a consequence of being a template function now, it no
+ longer accepts arguments that merely implicitly convert to floating-point
+ types. A backwards-compatible fix is to cast such types to one of the C++
+ floating-point types.
\sa QLocale::toString(), QLocale::FloatingPointPrecisionOption, {Number Formats}
*/