![]() |
Qt 6.x
The Qt SDK
|
The QSequentialIterable class is an iterable interface for a container in a QVariant. More...
#include <qsequentialiterable.h>
Inheritance diagram for QSequentialIterable:
Collaboration diagram for QSequentialIterable:Public Types | |
| enum | Position { Unspecified , AtBegin , AtEnd } |
| using | iterator = QTaggedIterator< QSequentialIterator, void > |
| using | const_iterator = QTaggedIterator< QSequentialConstIterator, void > |
| using | RandomAccessIterator = QTaggedIterator< iterator, std::random_access_iterator_tag > |
| Exposes an iterator using std::random_access_iterator_tag. | |
| using | BidirectionalIterator = QTaggedIterator< iterator, std::bidirectional_iterator_tag > |
| Exposes an iterator using std::bidirectional_iterator_tag. | |
| using | ForwardIterator = QTaggedIterator< iterator, std::forward_iterator_tag > |
| Exposes an iterator using std::forward_iterator_tag. | |
| using | InputIterator = QTaggedIterator< iterator, std::input_iterator_tag > |
| Exposes an iterator using std::input_iterator_tag. | |
| using | RandomAccessConstIterator = QTaggedIterator< const_iterator, std::random_access_iterator_tag > |
| Exposes a const_iterator using std::random_access_iterator_tag. | |
| using | BidirectionalConstIterator = QTaggedIterator< const_iterator, std::bidirectional_iterator_tag > |
| Exposes a const_iterator using std::bidirectional_iterator_tag. | |
| using | ForwardConstIterator = QTaggedIterator< const_iterator, std::forward_iterator_tag > |
| Exposes a const_iterator using std::forward_iterator_tag. | |
| using | InputConstIterator = QTaggedIterator< const_iterator, std::input_iterator_tag > |
| Exposes a const_iterator using std::input_iterator_tag. | |
Public Member Functions | |
| template<class T > | |
| QSequentialIterable (const T *p) | |
| template<class T > | |
| QSequentialIterable (T *p) | |
| QSequentialIterable () | |
| template<typename Pointer > | |
| QSequentialIterable (const QMetaSequence &metaSequence, Pointer iterable) | |
| QSequentialIterable (const QMetaSequence &metaSequence, const QMetaType &metaType, void *iterable) | |
| QSequentialIterable (const QMetaSequence &metaSequence, const QMetaType &metaType, const void *iterable) | |
| QSequentialIterable (QIterable< QMetaSequence > &&other) | |
| QSequentialIterable & | operator= (QIterable< QMetaSequence > &&other) |
| const_iterator | begin () const |
| const_iterator | end () const |
| const_iterator | constBegin () const |
| const_iterator | constEnd () const |
| iterator | mutableBegin () |
| iterator | mutableEnd () |
| QVariant | at (qsizetype idx) const |
| Returns the value at position idx in the container. | |
| void | set (qsizetype idx, const QVariant &value) |
| Sets the element at position idx in the container to value. | |
| void | addValue (const QVariant &value, Position position=Unspecified) |
| Adds value to the container, at position, if possible. | |
| void | removeValue (Position position=Unspecified) |
| Removes a value from the container, at position, if possible. | |
| QMetaType | valueMetaType () const |
Public Member Functions inherited from QIterable< QMetaSequence > | |
| QIterable (const QMetaSequence &metaContainer, const T *p) | |
| QIterable (const QMetaSequence &metaContainer, T *p) | |
| QIterable (const QMetaSequence &metaContainer, Pointer iterable) | |
| QIterable (const QMetaSequence &metaContainer, qsizetype alignment, const void *p) | |
| QIterable (const QMetaSequence &metaContainer, qsizetype alignment, void *p) | |
| bool | canInputIterate () const |
| Returns whether the container has an input iterator. | |
| bool | canForwardIterate () const |
| Returns whether it is possible to iterate over the container in forward direction. | |
| bool | canReverseIterate () const |
| Returns whether it is possible to iterate over the container in reverse. | |
| bool | canRandomAccessIterate () const |
| Returns whether it is possible to efficiently skip over multiple values using and iterator. | |
| const void * | constIterable () const |
| void * | mutableIterable () |
| QConstIterator< QMetaSequence > | constBegin () const |
| Returns a QConstIterator for the beginning of the container. | |
| QConstIterator< QMetaSequence > | constEnd () const |
| Returns a Qterable::QConstIterator for the end of the container. | |
| QIterator< QMetaSequence > | mutableBegin () |
| Returns a QIterator for the beginning of the container. | |
| QIterator< QMetaSequence > | mutableEnd () |
| Returns a QSequentialIterable::iterator for the end of the container. | |
| qsizetype | size () const |
| Returns the number of values in the container. | |
| QMetaSequence | metaContainer () const |
Additional Inherited Members | |
Protected Attributes inherited from QIterable< QMetaSequence > | |
| uint | m_revision |
| QtPrivate::QConstPreservingPointer< void, quint16 > | m_iterable |
| QMetaSequence | m_metaContainer |
The QSequentialIterable class is an iterable interface for a container in a QVariant.
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.
Definition at line 42 of file qsequentialiterable.h.
Exposes a const_iterator using std::bidirectional_iterator_tag.
Definition at line 54 of file qsequentialiterable.h.
Exposes an iterator using std::bidirectional_iterator_tag.
Definition at line 49 of file qsequentialiterable.h.
Definition at line 46 of file qsequentialiterable.h.
Exposes a const_iterator using std::forward_iterator_tag.
Definition at line 55 of file qsequentialiterable.h.
Exposes an iterator using std::forward_iterator_tag.
Definition at line 50 of file qsequentialiterable.h.
Exposes a const_iterator using std::input_iterator_tag.
Definition at line 56 of file qsequentialiterable.h.
Exposes an iterator using std::input_iterator_tag.
Definition at line 51 of file qsequentialiterable.h.
Definition at line 45 of file qsequentialiterable.h.
Exposes a const_iterator using std::random_access_iterator_tag.
Definition at line 53 of file qsequentialiterable.h.
Exposes an iterator using std::random_access_iterator_tag.
Definition at line 48 of file qsequentialiterable.h.
| Enumerator | |
|---|---|
| Unspecified | |
| AtBegin | |
| AtEnd | |
Definition at line 116 of file qsequentialiterable.h.
|
inline |
Definition at line 59 of file qsequentialiterable.h.
References Q_UNUSED.
|
inline |
Definition at line 66 of file qsequentialiterable.h.
|
inline |
Definition at line 71 of file qsequentialiterable.h.
|
inline |
Definition at line 77 of file qsequentialiterable.h.
|
inline |
Definition at line 83 of file qsequentialiterable.h.
|
inline |
Definition at line 90 of file qsequentialiterable.h.
|
inline |
Definition at line 96 of file qsequentialiterable.h.
| void QSequentialIterable::addValue | ( | const QVariant & | value, |
| Position | position = Unspecified |
||
| ) |
Adds value to the container, at position, if possible.
Definition at line 71 of file qsequentialiterable.cpp.
References QMetaSequence::addValue(), QMetaSequence::addValueAtBegin(), QMetaSequence::addValueAtEnd(), AtBegin, AtEnd, QtPrivate::QVariantTypeCoercer::coerce(), QIterable< QMetaSequence >::metaContainer(), QIterable< QMetaSequence >::mutableIterable(), position(), Unspecified, and valueMetaType().
Referenced by convertToIterable().
Here is the call graph for this function:
Here is the caller graph for this function:Returns the value at position idx in the container.
Definition at line 121 of file qsequentialiterable.cpp.
References QMetaContainer::advanceConstIterator(), QMetaSequence::canGetValueAtConstIterator(), QMetaSequence::canGetValueAtIndex(), QMetaContainer::constBegin(), QtPrivate::QConstPreservingPointer< Type, Storage >::constPointer(), QMetaContainer::destroyConstIterator(), QIterable< QMetaSequence >::m_iterable, QIterable< QMetaSequence >::metaContainer(), QMetaSequence::valueAtConstIterator(), QMetaSequence::valueAtIndex(), and valueMetaType().
Here is the call graph for this function:
|
inline |
Definition at line 104 of file qsequentialiterable.h.
Referenced by if().
Here is the caller graph for this function:
|
inline |
Definition at line 107 of file qsequentialiterable.h.
References QIterable< Container >::constBegin().
Referenced by QV4::ExecutionEngine::fromData(), and QQmlListAccessor::setList().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 108 of file qsequentialiterable.h.
References QIterable< Container >::constEnd().
Referenced by QV4::ExecutionEngine::fromData(), and QQmlListAccessor::setList().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 105 of file qsequentialiterable.h.
Referenced by if().
Here is the caller graph for this function:
|
inline |
Definition at line 110 of file qsequentialiterable.h.
References QIterable< Container >::mutableBegin().
Referenced by QV4::sortSequence().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 111 of file qsequentialiterable.h.
References QIterable< Container >::mutableEnd().
Referenced by QV4::sortSequence().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 98 of file qsequentialiterable.h.
References other().
Here is the call graph for this function:| void QSequentialIterable::removeValue | ( | Position | position = Unspecified | ) |
Removes a value from the container, at position, if possible.
Definition at line 95 of file qsequentialiterable.cpp.
References AtBegin, AtEnd, QIterable< QMetaSequence >::metaContainer(), QIterable< QMetaSequence >::mutableIterable(), position(), QMetaSequence::removeValue(), QMetaSequence::removeValueAtBegin(), QMetaSequence::removeValueAtEnd(), and Unspecified.
Here is the call graph for this function:Sets the element at position idx in the container to value.
Definition at line 146 of file qsequentialiterable.cpp.
References QMetaContainer::advanceIterator(), QMetaContainer::begin(), QMetaSequence::canSetValueAtIndex(), QMetaSequence::canSetValueAtIterator(), QtPrivate::QVariantTypeCoercer::coerce(), QMetaContainer::destroyIterator(), QIterable< QMetaSequence >::m_iterable, QIterable< QMetaSequence >::metaContainer(), QtPrivate::QConstPreservingPointer< Type, Storage >::mutablePointer(), QMetaSequence::setValueAtIndex(), QMetaSequence::setValueAtIterator(), and valueMetaType().
Here is the call graph for this function:| QMetaType QSequentialIterable::valueMetaType | ( | ) | const |
Definition at line 113 of file qsequentialiterable.cpp.
References QIterable< QMetaSequence >::metaContainer(), and valueMetaType().
Referenced by addValue(), at(), convertToIterable(), iterateQObjectContainer(), set(), valueMetaType(), and QQmlPropertyPrivate::write().
Here is the call graph for this function:
Here is the caller graph for this function: