Struct QTreeWidgetItemIterator

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

The QTreeWidgetItemIterator class provides a way to iterate over the items in a QTreeWidget instance.

C++ class: QTreeWidgetItemIterator.

C++ documentation:

The QTreeWidgetItemIterator class provides a way to iterate over the items in a QTreeWidget instance.

The iterator will walk the items in a pre-order traversal order, thus visiting the parent node before it continues to the child nodes.

For example, the following code examples each item in a tree, checking the text in the first column against a user-specified search string:

QTreeWidgetItemIterator it(treeWidget); while (it) { if ((it)->text(0) == itemText) (*it)->setSelected(true); ++it; }

It is also possible to filter out certain types of node by passing certain flags to the constructor of QTreeWidgetItemIterator.

Implementations§

Source§

impl QTreeWidgetItemIterator

Source

pub unsafe fn add_assign(&self, n: c_int) -> Ref<QTreeWidgetItemIterator>

Makes the iterator go forward by n matching items. (If n is negative, the iterator goes backward.)

Calls C++ function: QTreeWidgetItemIterator& QTreeWidgetItemIterator::operator+=(int n).

C++ documentation:

Makes the iterator go forward by n matching items. (If n is negative, the iterator goes backward.)

If the current item is beyond the last item, the current item pointer is set to 0. Returns the resulting iterator.

Source

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

Assignment. Makes a copy of it and returns a reference to its iterator.

Calls C++ function: QTreeWidgetItemIterator& QTreeWidgetItemIterator::operator=(const QTreeWidgetItemIterator& it).

C++ documentation:

Assignment. Makes a copy of it and returns a reference to its iterator.

Source

pub unsafe fn dec(&self) -> Ref<QTreeWidgetItemIterator>

The prefix -- operator (--it) advances the iterator to the previous matching item and returns a reference to the resulting iterator. Sets the current pointer to 0 if the current item is the first matching item.

Calls C++ function: QTreeWidgetItemIterator& QTreeWidgetItemIterator::operator--().

C++ documentation:

The prefix – operator (–it) advances the iterator to the previous matching item and returns a reference to the resulting iterator. Sets the current pointer to 0 if the current item is the first matching item.

Source

pub unsafe fn dec_postfix(&self, arg1: c_int) -> CppBox<QTreeWidgetItemIterator>

The postfix -- operator (it--) makes the preceding matching item current and returns an iterator to the previously current item.

Calls C++ function: QTreeWidgetItemIterator QTreeWidgetItemIterator::operator--(int arg1).

C++ documentation:

The postfix – operator (it–) makes the preceding matching item current and returns an iterator to the previously current item.

Source

pub unsafe fn inc(&self) -> Ref<QTreeWidgetItemIterator>

The prefix ++ operator (++it) advances the iterator to the next matching item and returns a reference to the resulting iterator. Sets the current pointer to 0 if the current item is the last matching item.

Calls C++ function: QTreeWidgetItemIterator& QTreeWidgetItemIterator::operator++().

C++ documentation:

The prefix ++ operator (++it) advances the iterator to the next matching item and returns a reference to the resulting iterator. Sets the current pointer to 0 if the current item is the last matching item.

Source

pub unsafe fn inc_postfix(&self, arg1: c_int) -> CppBox<QTreeWidgetItemIterator>

The postfix ++ operator (it++) advances the iterator to the next matching item and returns an iterator to the previously current item.

Calls C++ function: QTreeWidgetItemIterator QTreeWidgetItemIterator::operator++(int arg1).

C++ documentation:

The postfix ++ operator (it++) advances the iterator to the next matching item and returns an iterator to the previously current item.

Source

pub unsafe fn indirection(&self) -> Ptr<QTreeWidgetItem>

Dereference operator. Returns a pointer to the current item.

Calls C++ function: QTreeWidgetItem* QTreeWidgetItemIterator::operator*() const.

C++ documentation:

Dereference operator. Returns a pointer to the current item.

Source

pub unsafe fn from_q_tree_widget_q_flags_iterator_flag( widget: impl CastInto<Ptr<QTreeWidget>>, flags: QFlags<IteratorFlag>, ) -> CppBox<QTreeWidgetItemIterator>

Constructs an iterator for the given widget that uses the specified flags to determine which items are found during iteration. The iterator is set to point to the first top-level item contained in the widget, or the next matching item if the top-level item doesn't match the flags.

Calls C++ function: [constructor] void QTreeWidgetItemIterator::QTreeWidgetItemIterator(QTreeWidget* widget, QFlags<QTreeWidgetItemIterator::IteratorFlag> flags = …).

C++ documentation:

Constructs an iterator for the given widget that uses the specified flags to determine which items are found during iteration. The iterator is set to point to the first top-level item contained in the widget, or the next matching item if the top-level item doesn’t match the flags.

See also QTreeWidgetItemIterator::IteratorFlag.

Source

pub unsafe fn from_q_tree_widget_item_q_flags_iterator_flag( item: impl CastInto<Ptr<QTreeWidgetItem>>, flags: QFlags<IteratorFlag>, ) -> CppBox<QTreeWidgetItemIterator>

Constructs an iterator for the given item that uses the specified flags to determine which items are found during iteration. The iterator is set to point to item, or the next matching item if item doesn't match the flags.

Calls C++ function: [constructor] void QTreeWidgetItemIterator::QTreeWidgetItemIterator(QTreeWidgetItem* item, QFlags<QTreeWidgetItemIterator::IteratorFlag> flags = …).

C++ documentation:

Constructs an iterator for the given item that uses the specified flags to determine which items are found during iteration. The iterator is set to point to item, or the next matching item if item doesn’t match the flags.

See also QTreeWidgetItemIterator::IteratorFlag.

Source

pub unsafe fn from_q_tree_widget( widget: impl CastInto<Ptr<QTreeWidget>>, ) -> CppBox<QTreeWidgetItemIterator>

Constructs an iterator for the given widget that uses the specified flags to determine which items are found during iteration. The iterator is set to point to the first top-level item contained in the widget, or the next matching item if the top-level item doesn't match the flags.

Calls C++ function: [constructor] void QTreeWidgetItemIterator::QTreeWidgetItemIterator(QTreeWidget* widget).

C++ documentation:

Constructs an iterator for the given widget that uses the specified flags to determine which items are found during iteration. The iterator is set to point to the first top-level item contained in the widget, or the next matching item if the top-level item doesn’t match the flags.

See also QTreeWidgetItemIterator::IteratorFlag.

Source

pub unsafe fn from_q_tree_widget_item( item: impl CastInto<Ptr<QTreeWidgetItem>>, ) -> CppBox<QTreeWidgetItemIterator>

Constructs an iterator for the given item that uses the specified flags to determine which items are found during iteration. The iterator is set to point to item, or the next matching item if item doesn't match the flags.

Calls C++ function: [constructor] void QTreeWidgetItemIterator::QTreeWidgetItemIterator(QTreeWidgetItem* item).

C++ documentation:

Constructs an iterator for the given item that uses the specified flags to determine which items are found during iteration. The iterator is set to point to item, or the next matching item if item doesn’t match the flags.

See also QTreeWidgetItemIterator::IteratorFlag.

Source

pub unsafe fn new_copy( it: impl CastInto<Ref<QTreeWidgetItemIterator>>, ) -> CppBox<QTreeWidgetItemIterator>

Constructs an iterator for the same QTreeWidget as it. The current iterator item is set to point on the current item of it.

Calls C++ function: [constructor] void QTreeWidgetItemIterator::QTreeWidgetItemIterator(const QTreeWidgetItemIterator& it).

C++ documentation:

Constructs an iterator for the same QTreeWidget as it. The current iterator item is set to point on the current item of it.

Source

pub unsafe fn sub_assign(&self, n: c_int) -> Ref<QTreeWidgetItemIterator>

Makes the iterator go backward by n matching items. (If n is negative, the iterator goes forward.)

Calls C++ function: QTreeWidgetItemIterator& QTreeWidgetItemIterator::operator-=(int n).

C++ documentation:

Makes the iterator go backward by n matching items. (If n is negative, the iterator goes forward.)

If the current item is ahead of the last item, the current item pointer is set to 0. Returns the resulting iterator.

Trait Implementations§

Source§

impl CppDeletable for QTreeWidgetItemIterator

Source§

unsafe fn delete(&self)

Destroys the iterator.

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

C++ documentation:

Destroys the iterator.

Source§

impl Decrement for QTreeWidgetItemIterator

Source§

unsafe fn dec(&self) -> Ref<QTreeWidgetItemIterator>

The prefix -- operator (--it) advances the iterator to the previous matching item and returns a reference to the resulting iterator. Sets the current pointer to 0 if the current item is the first matching item.

Calls C++ function: QTreeWidgetItemIterator& QTreeWidgetItemIterator::operator--().

C++ documentation:

The prefix – operator (–it) advances the iterator to the previous matching item and returns a reference to the resulting iterator. Sets the current pointer to 0 if the current item is the first matching item.

Source§

type Output = Ref<QTreeWidgetItemIterator>

Output type.
Source§

impl Increment for QTreeWidgetItemIterator

Source§

unsafe fn inc(&self) -> Ref<QTreeWidgetItemIterator>

The prefix ++ operator (++it) advances the iterator to the next matching item and returns a reference to the resulting iterator. Sets the current pointer to 0 if the current item is the last matching item.

Calls C++ function: QTreeWidgetItemIterator& QTreeWidgetItemIterator::operator++().

C++ documentation:

The prefix ++ operator (++it) advances the iterator to the next matching item and returns a reference to the resulting iterator. Sets the current pointer to 0 if the current item is the last matching item.

Source§

type Output = Ref<QTreeWidgetItemIterator>

Output type.
Source§

impl Indirection for QTreeWidgetItemIterator

Source§

unsafe fn indirection(&self) -> Ptr<QTreeWidgetItem>

Dereference operator. Returns a pointer to the current item.

Calls C++ function: QTreeWidgetItem* QTreeWidgetItemIterator::operator*() const.

C++ documentation:

Dereference operator. Returns a pointer to the current item.

Source§

type Output = Ptr<QTreeWidgetItem>

Output type.

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>,

Source§

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>,

Source§

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.