diff options
author | Albert Astals Cid <albert.astals.cid@kdab.com> | 2018-07-27 17:46:04 +0200 |
---|---|---|
committer | Albert Astals Cid <albert.astals.cid@kdab.com> | 2019-01-22 15:07:29 +0000 |
commit | e0567d137df4ff3978f767fa723ae05a7b0ab546 (patch) | |
tree | d85ba53515c7427a71fefd58f0d40b02bcdb9a21 /src/corelib/tools/qstringlist.cpp | |
parent | 503ff495aac77e957f711f19275ab1754228cfeb (diff) |
Add QStringList::indexOf/lastIndexOf for QStringView and QLatin1String
Change-Id: I42eac69c1f7ab88441d464b9d325139defe32b03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qstringlist.cpp')
-rw-r--r-- | src/corelib/tools/qstringlist.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp index ec6de08805..cc6eaf8ad2 100644 --- a/src/corelib/tools/qstringlist.cpp +++ b/src/corelib/tools/qstringlist.cpp @@ -376,6 +376,56 @@ bool QtPrivate::QStringList_contains(const QStringList *that, QLatin1String str, return stringList_contains(*that, str, cs); } +/*! + \fn bool QStringList::indexOf(QStringView str, int from) const + \overload + \since 5.13 + + Returns the index position of the first occurrence of \a str in + the list, searching forward from index position \a from. Returns + -1 if no item matched. + + \sa lastIndexOf(), contains() + */ + +/*! + \fn bool QStringList::indexOf(QLatin1String str, int from) const + \overload + \since 5.13 + + Returns the index position of the first occurrence of \a str in + the list, searching forward from index position \a from. Returns + -1 if no item matched. + + \sa lastIndexOf(), contains() + */ + +/*! + \fn bool QStringList::lastIndexOf(QStringView str, int from) const + \overload + \since 5.13 + + Returns the index position of the last occurrence of \a str in + the list, 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. + + \sa indexOf(), contains() + */ + +/*! + \fn bool QStringList::lastIndexOf(QLatin1String str, int from) const + \overload + \since 5.13 + + Returns the index position of the last occurrence of \a str in + the list, 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. + + \sa indexOf(), contains() + */ + #ifndef QT_NO_REGEXP /*! \fn QStringList QStringList::filter(const QRegExp &rx) const |