The QMutableListIterator class provides a Java style iterator for QList and QQueue.
More...
template<class T>
class QMutableListIterator< T >
The QMutableListIterator class provides a Java-style non-const iterator for QList and QQueue. For more information refer to Java style iterators.
- See also
- QListIterator, QList::iterator
template<class T >
QMutableListIterator< T >::QMutableListIterator |
( |
QList< T > & |
list | ) |
|
|
inline |
Constructs an iterator for traversing list. The iterator is set to the beginning of the list before the first item.
- See also
- operator=()
template<class T >
QMutableListIterator< T >::~QMutableListIterator |
( |
| ) |
|
|
default |
template<class T >
bool QMutableListIterator< T >::findNext |
( |
const T & |
value | ) |
|
|
inline |
Searches for value starting from the current iterator position and moving forward. Returns true if the specified value is found, otherwise it returns false. If value is found the iterator is positioned just after the matching item, otherwise the iterator is positioned at the end of the container.
- See also
- findPrevious()
template<class T >
bool QMutableListIterator< T >::findPrevious |
( |
const T & |
value | ) |
|
|
inline |
Searches for value starting from the current iterator position and moving backward. Returns true if the specified value is found, otherwise it returns false. If value was found the iterator is positioned just before the matching item. Otherwise the iterator is positioned at the beginning of the container.
- See also
- findNext()
template<class T >
bool QMutableListIterator< T >::hasNext |
( |
| ) |
const |
|
inline |
Returns true if there is at least one item after the iterator, otherwise returns false.
- See also
- hasPrevious(), next()
template<class T >
bool QMutableListIterator< T >::hasPrevious |
( |
| ) |
const |
|
inline |
Returns true if there is at least one item before the iterator, otherwise returns false.
- See also
- hasNext(), previous()
template<class T >
void QMutableListIterator< T >::insert |
( |
const T & |
value | ) |
|
|
inline |
Inserts value at the current iterator position. After calling this method the iterator is located just after the inserted item.
- See also
- remove(), setValue()
template<class T >
T & QMutableListIterator< T >::next |
( |
| ) |
|
|
inline |
Returns a reference to the next item and advances the iterator by one position. Calling this method on an iterator located at the end of the container causes undefined behavior.
- See also
- hasNext(), peekNext(), previous()
template<class T >
QMutableListIterator & QMutableListIterator< T >::operator= |
( |
QList< T > & |
list | ) |
|
|
inline |
Sets the iterator to the beginning of the list before the first item.
- See also
- toFront(), toBack()
template<class T >
T & QMutableListIterator< T >::peekNext |
( |
| ) |
const |
|
inline |
Returns a reference to the next item without moving the iterator. Calling this method on an iterator located at the end of the container causes undefined behavior.
- See also
- hasNext(), next(), peekPrevious()
template<class T >
T & QMutableListIterator< T >::peekPrevious |
( |
| ) |
const |
|
inline |
Returns a reference to the previous item without moving the iterator. Calling this method on an iterator located at the beginning of the container causes undefined behavior.
- See also
- hasPrevious(), peekNext(), previous()
template<class T >
T & QMutableListIterator< T >::previous |
( |
| ) |
|
|
inline |
Returns a reference to the previous item and moves the iterator back by one position. Calling this method on an iterator located at the beginning of the container causes undefined behavior.
- See also
- hasPrevious(), next(), peekPrevious()
template<class T >
void QMutableListIterator< T >::remove |
( |
| ) |
|
|
inline |
template<class T >
void QMutableListIterator< T >::setValue |
( |
const T & |
value | ) |
const |
|
inline |
Replaces the value of the last item with the given value.
while (iter.hasNext()) {
double val = iter.next();
iter.setValue(sqrt(val));
}
- See also
- insert(), remove(), value()
template<class T >
void QMutableListIterator< T >::toBack |
( |
| ) |
|
|
inline |
Moves the iterator to the end of the container after the last item.
- See also
- toFront(), previous()
template<class T >
void QMutableListIterator< T >::toFront |
( |
| ) |
|
|
inline |
Moves the iterator to the beginning of the container before the first item.
- See also
- toBack(), next()
template<class T >
T & QMutableListIterator< T >::value |
( |
| ) |
|
|
inline |
Returns a non-const reference to the value of the last item that was jumped over using one of the traversal methods.
template<class T >
const T & QMutableListIterator< T >::value |
( |
| ) |
const |
|
inline |