QSequentialIterable Class | Qt Core | Qt 6.11.0
Description: The QSequentialIterable class is an iterable interface for a container in a QVariant.

- Qt 6.11
- Qt Core
- C++ Classes
- QSequentialIterable
- Qt 6.11.0 Reference Documentation

# QSequentialIterable Class

The QSequentialIterable class is an iterable interface for a container in a QVariant. More...

Header: | `#include <QSequentialIterable>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS Core)` `target_link_libraries(mytarget PRIVATE Qt6::Core)`
qmake: | `QT += core`
Inherits: | QIterable
Status: | Until 6.15

This class is scheduled for deprecation in version 6.15.

- List of all members, including inherited members

## Public Types

| BidirectionalConstIterator
| BidirectionalIterator
| ForwardConstIterator
| ForwardIterator
| InputConstIterator
| InputIterator
| RandomAccessConstIterator
| RandomAccessIterator
`(until 6.15)` | const_iterator
`(since 6.0, until 6.15)` | iterator

## Public Functions

void | addValue(const QVariant &value, QSequentialIterable::Position position = Unspecified)
QVariant | at(qsizetype idx) const
void | removeValue(QSequentialIterable::Position position = Unspecified)
void | set(qsizetype idx, const QVariant &value)

## Detailed Description

Use QMetaSequence::Iterable instead.

This class allows several methods of accessing the values of a container held within a QVariant. An instance of QSequentialIterable can be extracted from a QVariant if it can be converted to a QVariantList.

The container itself is not copied before iterating over it.

See also QVariant.

## Member Type Documentation

### `[alias]` QSequentialIterable::BidirectionalConstIterator

Exposes a const_iterator using std::bidirectional_iterator_tag.

### `[alias]` QSequentialIterable::BidirectionalIterator

Exposes an iterator using std::bidirectional_iterator_tag.

### `[alias]` QSequentialIterable::ForwardConstIterator

Exposes a const_iterator using std::forward_iterator_tag.

### `[alias]` QSequentialIterable::ForwardIterator

Exposes an iterator using std::forward_iterator_tag.

### `[alias]` QSequentialIterable::InputConstIterator

Exposes a const_iterator using std::input_iterator_tag.

### `[alias]` QSequentialIterable::InputIterator

Exposes an iterator using std::input_iterator_tag.

### `[alias]` QSequentialIterable::RandomAccessConstIterator

Exposes a const_iterator using std::random_access_iterator_tag.

### `[alias]` QSequentialIterable::RandomAccessIterator

Exposes an iterator using std::random_access_iterator_tag.

### `[alias, until 6.15]` QSequentialIterable::const_iterator

This typedef is scheduled for deprecation in version 6.15.

Use QMetaSequence::Iterable::ConstIterator instead.

The QSequentialIterable::const_iterator allows iteration over a container in a QVariant.

A QSequentialIterable::const_iterator can only be created by a QSequentialIterable instance, and can be used in a way similar to other stl-style iterators.

### `[alias, since 6.0, until 6.15]` QSequentialIterable::iterator

This typedef is scheduled for deprecation in version 6.15.

Use QMetaSequence::Iterable::Iterator instead.

The QSequentialIterable::iterator allows iteration over a container in a QVariant.

A QSequentialIterable::iterator can only be created by a QSequentialIterable instance, and can be used in a way similar to other stl-style iterators.

This typedef was introduced in Qt 6.0.

## Member Function Documentation

### void QSequentialIterable::addValue(const QVariant &value, QSequentialIterable::Position position = Unspecified)

Adds value to the container, at position, if possible.

### QVariant QSequentialIterable::at(qsizetype idx) const

Returns the value at position idx in the container.

### void QSequentialIterable::removeValue(QSequentialIterable::Position position = Unspecified)

Removes a value from the container, at position, if possible.

### void QSequentialIterable::set(qsizetype idx, const QVariant &value)

Sets the element at position idx in the container to value.