#[repr(C)]
pub struct QSequentialIterable { /* private fields */ }
Expand description

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.

Implementations§

source§

impl QSequentialIterable

source

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

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.

source

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

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().

source

pub unsafe fn can_reverse_iterate(&self) -> bool

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.

source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QSequentialIterable>> ) -> Ref<QSequentialIterable>

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.

source

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

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().

source

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

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.

source

pub unsafe fn size(&self) -> c_int

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§

source§

impl Begin for QSequentialIterable

source§

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

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().

§

type Output = CppBox<ConstIterator>

Output type.
source§

impl CppDeletable for QSequentialIterable

source§

unsafe fn delete(&self)

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.

source§

impl End for QSequentialIterable

source§

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

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().

§

type Output = CppBox<ConstIterator>

Output type.
source§

impl Size for QSequentialIterable

source§

unsafe fn size(&self) -> usize

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.