From dc133765ec47e9625c49701f0ffd762b0ee1ad48 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Fri, 13 Jul 2018 08:56:52 +0200 Subject: Doc: harmonize toDouble() and toFloat() for QString and QByteArray Change-Id: Ic81461899c73c8a68bc3b8bdc1de4be4dd6bdf27 Reviewed-by: Martin Smith --- src/corelib/tools/qbytearray.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/corelib/tools/qbytearray.cpp') 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() */ -- cgit v1.2.3