[−][src]Struct qt_core::QSequentialIterable
The QSequentialIterable class is an iterable interface for a container in a QVariant.
C++ class: QSequentialIterable
.
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
.
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
.
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
.
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]
&mut self,
other: impl CastInto<Ref<QSequentialIterable>>
) -> MutRef<QSequentialIterable>
The QSequentialIterable class is an iterable interface for a container in a QVariant.
Calls C++ function: QSequentialIterable& QSequentialIterable::operator=(const QSequentialIterable& other)
.
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
.
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]
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)
.
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
.
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
.
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()
.
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
.
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]
Auto Trait Implementations
impl RefUnwindSafe for QSequentialIterable
impl Send for QSequentialIterable
impl Sync for QSequentialIterable
impl Unpin for QSequentialIterable
impl UnwindSafe for QSequentialIterable
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
unsafe fn static_upcast_mut(ptr: MutPtr<T>) -> MutPtr<T>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,