- Extending Qt Creator Manual
- QtTaskTree
- ListIterator
- Extending Qt Creator Manual 21.0.0-beta1

# QtTaskTree::ListIterator Class

template <typename T> class QtTaskTree::ListIterator

The list iterator to be used inside For element. More...

Header: | `#include <qtasktree.h>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS TaskTree)` `target_link_libraries(mytarget PRIVATE Qt6::TaskTree)`
qmake: | `QT += tasktree`
Since: | 6.11
Inherits: | QtTaskTree::Iterator

- List of all members, including inherited members

Note: All functions in this class are reentrant.

## Public Functions

| ListIterator(const QList<T> &list)
const T & | operator*() const
const T * | operator->() const

## Detailed Description

The template parameter T specifies the element type of the list being iterated.

See also Iterator, ForeverIterator, RepeatIterator, and UntilIterator.

## Member Function Documentation

### `[explicit]` ListIterator::ListIterator(const QList<T> &list)

Constructs the list iterator for the For (ListIterator(list)) >> Do {} construct. The iterator will iterate over each element from the passed list.

See also Iterator::iteration().

### const T &ListIterator::operator*() const

Returns a reference to the current element inside a Do body. Use this function only from inside the handler body of any GroupItem element placed in the QtTaskTree::Do body of the recipe, otherwise you may expect a crash. Make sure that ListIterator is passed to the For element.

### const T *ListIterator::operator->() const

Returns a pointer to the current element inside a Do body. Use this function only from inside the handler body of any GroupItem element placed in the QtTaskTree::Do body of the recipe, otherwise you may expect a crash. Make sure that ListIterator is passed to the For element.