From 48f1ebc0404983381ddd2cc2a3b5ecc1a12785c3 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 4 Dec 2013 14:11:39 +0100 Subject: Add QVarLengthArray::{indexOf,lastIndexOf,contains} functions [ChangeLog][QtCore][QVarLengthArray] Added the indexOf, lastIndexOf and contains functions to QVarLengthArray. These functions make the class more similar to QVector. Change-Id: I9bd2b22bd8b7151c2d17aede36e5f2126570600b Reviewed-by: Oswald Buddenhagen Reviewed-by: Olivier Goffart --- src/corelib/tools/qvarlengtharray.qdoc | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'src/corelib/tools/qvarlengtharray.qdoc') diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc index db435739fc..05d9258c86 100644 --- a/src/corelib/tools/qvarlengtharray.qdoc +++ b/src/corelib/tools/qvarlengtharray.qdoc @@ -671,3 +671,42 @@ \sa append(), operator<<() */ +/*! \fn int QVarLengthArray::indexOf(const T &value, int from = 0) const + + \since 5.3 + Returns the index position of the first occurrence of \a value in + the array, searching forward from index position \a from. + Returns -1 if no item matched. + + This function requires the value type to have an implementation of + \c operator==(). + + \sa lastIndexOf(), contains() +*/ + +/*! \fn int QVarLengthArray::lastIndexOf(const T &value, int from = -1) const + + \since 5.3 + Returns the index position of the last occurrence of the value \a + value in the array, searching backward from index position \a + from. If \a from is -1 (the default), the search starts at the + last item. Returns -1 if no item matched. + + This function requires the value type to have an implementation of + \c operator==(). + + \sa indexOf(), contains() +*/ + +/*! \fn bool QVarLengthArray::contains(const T &value) const + + \since 5.3 + Returns \c true if the array contains an occurrence of \a value; + otherwise returns \c false. + + This function requires the value type to have an implementation of + \c operator==(). + + \sa indexOf(), lastIndexOf() +*/ + -- cgit v1.2.3