summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qbytearray.cpp
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@nokia.com>2012-05-24 10:42:44 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-26 02:47:01 +0200
commitccd56e984497771de7e13bdc286a156296cff58f (patch)
treecc835afa66a07fb5ba637f02bf615049e8336e47 /src/corelib/tools/qbytearray.cpp
parent9a17206b5c9cfaec5f2bff887dfb54bdb572287f (diff)
Clarify QByteArray::size() documentation.
QTBUG-25438 Change-Id: I8cf9bfb295195548b6f7d4410682e4d675181a65 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'src/corelib/tools/qbytearray.cpp')
-rw-r--r--src/corelib/tools/qbytearray.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index c92c269cac..d93c51b7c1 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -681,7 +681,12 @@ static inline char qToLower(char c)
A QByteArray can embed '\\0' bytes. The size() function always
returns the size of the whole array, including embedded '\\0'
- bytes. If you want to obtain the length of the data up to and
+ bytes, but excluding the terminating '\\0' added by QByteArray.
+ For example:
+
+ \snippet code/src_corelib_tools_qbytearray.cpp 48
+
+ If you want to obtain the length of the data up to and
excluding the first '\\0' character, call qstrlen() on the byte
array.