[][src]Struct qt_core::QSequentialIterable

#[repr(C)]
pub struct QSequentialIterable { /* fields omitted */ }

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

C++ class: QSequentialIterable.

C++ documentation:

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

This class allows several methods of accessing the elements 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.

QList<int> intList = {7, 11, 42};

QVariant variant = QVariant::fromValue(intList); if (variant.canConvert<QVariantList>()) { QSequentialIterable iterable = variant.value<QSequentialIterable>(); // Can use foreach: foreach (const QVariant &v, iterable) { qDebug() << v; } // Can use C++11 range-for: for (const QVariant &v : iterable) { qDebug() << v; } // Can use iterators: QSequentialIterable::const_iterator it = iterable.begin(); const QSequentialIterable::const_iterator end = iterable.end(); for ( ; it != end; ++it) { qDebug() << *it; } }

The container itself is not copied before iterating over it.

Methods

impl QSequentialIterable[src]

pub unsafe fn at(&self, idx: c_int) -> CppBox<QVariant>[src]

Returns the element at position idx in the container.

Calls C++ function: QVariant QSequentialIterable::at(int idx) const.

C++ documentation:

Returns the element at position idx in the container.

pub unsafe fn begin(&self) -> CppBox<ConstIterator>[src]

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

Calls C++ function: QSequentialIterable::const_iterator QSequentialIterable::begin() const.

C++ documentation:

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

See also end().

pub unsafe fn can_reverse_iterate(&self) -> bool[src]

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.

Calls C++ function: bool QSequentialIterable::canReverseIterate() const.

C++ documentation:

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.

pub unsafe fn copy_from(
    &mut self,
    other: impl CastInto<Ref<QSequentialIterable>>
) -> MutRef<QSequentialIterable>
[src]

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

Calls C++ function: QSequentialIterable& QSequentialIterable::operator=(const QSequentialIterable& other).

C++ documentation:

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

This class allows several methods of accessing the elements 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.

QList<int> intList = {7, 11, 42};

QVariant variant = QVariant::fromValue(intList); if (variant.canConvert<QVariantList>()) { QSequentialIterable iterable = variant.value<QSequentialIterable>(); // Can use foreach: foreach (const QVariant &v, iterable) { qDebug() << v; } // Can use C++11 range-for: for (const QVariant &v : iterable) { qDebug() << v; } // Can use iterators: QSequentialIterable::const_iterator it = iterable.begin(); const QSequentialIterable::const_iterator end = iterable.end(); for ( ; it != end; ++it) { qDebug() << *it; } }

The container itself is not copied before iterating over it.

pub unsafe fn end(&self) -> CppBox<ConstIterator>[src]

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

Calls C++ function: QSequentialIterable::const_iterator QSequentialIterable::end() const.

C++ documentation:

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

See also begin().

pub unsafe fn new_copy(
    other: impl CastInto<Ref<QSequentialIterable>>
) -> CppBox<QSequentialIterable>
[src]

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

Calls C++ function: [constructor] void QSequentialIterable::QSequentialIterable(const QSequentialIterable& other).

C++ documentation:

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

This class allows several methods of accessing the elements 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.

QList<int> intList = {7, 11, 42};

QVariant variant = QVariant::fromValue(intList); if (variant.canConvert<QVariantList>()) { QSequentialIterable iterable = variant.value<QSequentialIterable>(); // Can use foreach: foreach (const QVariant &v, iterable) { qDebug() << v; } // Can use C++11 range-for: for (const QVariant &v : iterable) { qDebug() << v; } // Can use iterators: QSequentialIterable::const_iterator it = iterable.begin(); const QSequentialIterable::const_iterator end = iterable.end(); for ( ; it != end; ++it) { qDebug() << *it; } }

The container itself is not copied before iterating over it.

pub unsafe fn size(&self) -> c_int[src]

Returns the number of elements in the container.

Calls C++ function: int QSequentialIterable::size() const.

C++ documentation:

Returns the number of elements in the container.

Trait Implementations

impl Begin for QSequentialIterable[src]

type Output = CppBox<ConstIterator>

Output type.

unsafe fn begin(&self) -> CppBox<ConstIterator>[src]

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

Calls C++ function: QSequentialIterable::const_iterator QSequentialIterable::begin() const.

C++ documentation:

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

See also end().

impl CppDeletable for QSequentialIterable[src]

unsafe fn delete(&mut self)[src]

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

Calls C++ function: [destructor] void QSequentialIterable::~QSequentialIterable().

C++ documentation:

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

This class allows several methods of accessing the elements 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.

QList<int> intList = {7, 11, 42};

QVariant variant = QVariant::fromValue(intList); if (variant.canConvert<QVariantList>()) { QSequentialIterable iterable = variant.value<QSequentialIterable>(); // Can use foreach: foreach (const QVariant &v, iterable) { qDebug() << v; } // Can use C++11 range-for: for (const QVariant &v : iterable) { qDebug() << v; } // Can use iterators: QSequentialIterable::const_iterator it = iterable.begin(); const QSequentialIterable::const_iterator end = iterable.end(); for ( ; it != end; ++it) { qDebug() << *it; } }

The container itself is not copied before iterating over it.

impl End for QSequentialIterable[src]

type Output = CppBox<ConstIterator>

Output type.

unsafe fn end(&self) -> CppBox<ConstIterator>[src]

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

Calls C++ function: QSequentialIterable::const_iterator QSequentialIterable::end() const.

C++ documentation:

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

See also begin().

impl Size for QSequentialIterable[src]

unsafe fn size(&self) -> usize[src]

Returns the number of elements in the container.

Calls C++ function: int QSequentialIterable::size() const.

C++ documentation:

Returns the number of elements in the container.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.