summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qbytearray.cpp
diff options
context:
space:
mode:
authorAndre Hartmann <aha_1980@gmx.de>2018-07-13 08:56:52 +0200
committerAndré Hartmann <aha_1980@gmx.de>2018-07-14 09:55:40 +0000
commitdc133765ec47e9625c49701f0ffd762b0ee1ad48 (patch)
tree24b96d431347fde367ad3772d0ccaa35b9c2f162 /src/corelib/tools/qbytearray.cpp
parente92e46348ae0daf7d66a0ab843fc16d37cbc1c69 (diff)
Doc: harmonize toDouble() and toFloat() for QString and QByteArray
Change-Id: Ic81461899c73c8a68bc3b8bdc1de4be4dd6bdf27 Reviewed-by: Martin Smith <martin.smith@qt.io>
Diffstat (limited to 'src/corelib/tools/qbytearray.cpp')
-rw-r--r--src/corelib/tools/qbytearray.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 3a24176dc2..eb360bcad7 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -4124,9 +4124,16 @@ ushort QByteArray::toUShort(bool *ok, int base) const
\snippet code/src_corelib_tools_qbytearray.cpp 38
+ \warning The QByteArray content may only contain valid numerical characters
+ which includes the plus/minus sign, the characters g and e used in scientific
+ notation, and the decimal point. Including the unit or additional characters
+ leads to a conversion error.
+
\note The conversion of the number is performed in the default C locale,
irrespective of the user's locale.
+ This function ignores leading and trailing whitespace.
+
\sa number()
*/
@@ -4150,9 +4157,18 @@ double QByteArray::toDouble(bool *ok) const
If \a ok is not \c nullptr, failure is reported by setting *\a{ok}
to \c false, and success by setting *\a{ok} to \c true.
+ \snippet code/src_corelib_tools_qbytearray.cpp 38float
+
+ \warning The QByteArray content may only contain valid numerical characters
+ which includes the plus/minus sign, the characters g and e used in scientific
+ notation, and the decimal point. Including the unit or additional characters
+ leads to a conversion error.
+
\note The conversion of the number is performed in the default C locale,
irrespective of the user's locale.
+ This function ignores leading and trailing whitespace.
+
\sa number()
*/