summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@collabora.com>2011-12-09 17:21:12 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-12 17:27:19 +0100
commit6802e3165ea0d7c7bb5b4249ef1bb82f85febf86 (patch)
tree5c2ec37d676ef0ca1a0181c81148ed78bd56fa36 /src/corelib/tools
parent3ac957690c09992269e02d0ec7527cb406a0db23 (diff)
Add QVarLengthArray::length().
This also adds a unit test for length()/count()/size(), since there wasn't one testing it explicitly. Change-Id: Ifb7f113aa97beef5f76e5fb246eb38495344b0ad Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Marco Schmidt <Marco.Schmidt@Taugamma.de> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qvarlengtharray.h1
-rw-r--r--src/corelib/tools/qvarlengtharray.qdoc7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index 6da6cf524d..fd8c26c128 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -95,6 +95,7 @@ public:
}
inline int size() const { return s; }
inline int count() const { return s; }
+ inline int length() const { return s; }
inline bool isEmpty() const { return (s == 0); }
inline void resize(int size);
inline void clear() { resize(0); }
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc
index b1d7a1a5b1..a932e9fbcb 100644
--- a/src/corelib/tools/qvarlengtharray.qdoc
+++ b/src/corelib/tools/qvarlengtharray.qdoc
@@ -118,6 +118,13 @@
\sa isEmpty(), resize()
*/
+/*! \fn int QVarLengthArray::length() const
+
+ Same as size().
+
+ \sa isEmpty(), resize()
+*/
+
/*! \fn bool QVarLengthArray::isEmpty() const
Returns true if the array has size 0; otherwise returns false.