QIterable Class

template <typename Container> class QIterable

QIterable is a template class that is the base class for QSequentialIterable and QAssociativeIterable. More...

Header: #include <QIterable>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
Since: Qt 6.0
Inherited By:

QAssociativeIterable and QSequentialIterable

Public Functions

QIterable(const Container &metaContainer, const T *p)
QIterable(const Container &metaContainer, T *p)
QIterable(const Container &metaContainer, Pointer iterable)
QIterable(const Container &metaContainer, qsizetype alignment, const void *p)
QIterable(const Container &metaContainer, qsizetype alignment, void *p)
bool canForwardIterate() const
bool canInputIterate() const
bool canRandomAccessIterate() const
bool canReverseIterate() const
QConstIterator<Container> constBegin() const
QConstIterator<Container> constEnd() const
const void *constIterable() const
Container metaContainer() const
QIterator<Container> mutableBegin()
QIterator<Container> mutableEnd()
void *mutableIterable()
qsizetype size() const

Protected Variables

QtPrivate::QConstPreservingPointer<void, quint16> m_iterable
Container m_metaContainer
uint m_revision

Detailed Description

Member Function Documentation

template <typename T> QIterable::QIterable(const Container &metaContainer, const T *p)

Default constructs an instance of QIterable.

template <typename T> QIterable::QIterable(const Container &metaContainer, T *p)

Default constructs an instance of QIterable.

template <typename Pointer> QIterable::QIterable(const Container &metaContainer, Pointer iterable)

Default constructs an instance of QIterable.

QIterable::QIterable(const Container &metaContainer, qsizetype alignment, const void *p)

Default constructs an instance of QIterable.

QIterable::QIterable(const Container &metaContainer, qsizetype alignment, void *p)

Default constructs an instance of QIterable.

bool QIterable::canForwardIterate() const

Returns whether it is possible to iterate over the container in forward direction. This corresponds to the std::forward_iterator_tag iterator trait of the iterator and const_iterator of the container.

bool QIterable::canInputIterate() const

Returns whether the container has an input iterator. This corresponds to the std::input_iterator_tag iterator trait of the iterator and const_iterator of the container.

bool QIterable::canRandomAccessIterate() const

Returns whether it is possible to efficiently skip over multiple values using and iterator. This corresponds to the std::random_access_iterator_tag iterator trait of the iterator and const_iterator of the container.

bool QIterable::canReverseIterate() const

Returns whether it is possible to iterate over the container in reverse. This corresponds to the std::bidirectional_iterator_tag iterator trait of the const_iterator of the container.

QConstIterator<Container> QIterable::constBegin() const

Returns a QConstIterator for the beginning of the container. This can be used in stl-style iteration.

See also constEnd() and mutableBegin().

QConstIterator<Container> QIterable::constEnd() const

Returns a Qterable::QConstIterator for the end of the container. This can be used in stl-style iteration.

See also constBegin() and mutableEnd().

const void *QIterable::constIterable() const

Container QIterable::metaContainer() const

QIterator<Container> QIterable::mutableBegin()

Returns a QIterator for the beginning of the container. This can be used in stl-style iteration.

See also mutableEnd() and constBegin().

QIterator<Container> QIterable::mutableEnd()

Returns a QSequentialIterable::iterator for the end of the container. This can be used in stl-style iteration.

See also mutableBegin() and constEnd().

void *QIterable::mutableIterable()

qsizetype QIterable::size() const

Returns the number of values in the container.

Member Variable Documentation

QtPrivate::QConstPreservingPointer<void, quint16> QIterable::m_iterable

Container QIterable::m_metaContainer

uint QIterable::m_revision

© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.