CopperSpice API
1.9.2
|
The QTreeWidgetItemIterator class provides a way to iterate over the items in a QTreeWidget instance. More...
Public Typedefs | |
using | IteratorFlags = QFlags< IteratorFlag > |
Public Types | |
enum | IteratorFlag |
Public Methods | |
QTreeWidgetItemIterator (const QTreeWidgetItemIterator &iter) | |
QTreeWidgetItemIterator (QTreeWidget *widget, IteratorFlags flags=All) | |
QTreeWidgetItemIterator (QTreeWidgetItem *item, IteratorFlags flags=All) | |
~QTreeWidgetItemIterator () | |
QTreeWidgetItem * | operator* () const |
QTreeWidgetItemIterator & | operator++ () |
const QTreeWidgetItemIterator | operator++ (int) |
QTreeWidgetItemIterator & | operator+= (size_type n) |
QTreeWidgetItemIterator & | operator-- () |
const QTreeWidgetItemIterator | operator-- (int) |
QTreeWidgetItemIterator & | operator-= (size_type n) |
QTreeWidgetItemIterator & | operator= (const QTreeWidgetItemIterator &it) |
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.
The following code examples each item in a tree, checking the text in the first column against a user-specified search string:
It is also possible to filter out certain types of node by passing certain flags to the constructor of QTreeWidgetItemIterator.
Typedef for QFlags<IteratorFlag> which contains an OR combination of IteratorFlag values.
Refer to QTreeWidgetItemIterator::IteratorFlag for the enum documentation.
These flags can be passed to a QTreeWidgetItemIterator constructor (OR-ed together if more than one is used), so that the iterator will only iterate over items that match the given flags.
Constant | Value |
---|---|
QTreeWidgetItemIterator::All | 0x00000000 |
QTreeWidgetItemIterator::Hidden | 0x00000001 |
QTreeWidgetItemIterator::NotHidden | 0x00000002 |
QTreeWidgetItemIterator::Selected | 0x00000004 |
QTreeWidgetItemIterator::Unselected | 0x00000008 |
QTreeWidgetItemIterator::Selectable | 0x00000010 |
QTreeWidgetItemIterator::NotSelectable | 0x00000020 |
QTreeWidgetItemIterator::DragEnabled | 0x00000040 |
QTreeWidgetItemIterator::DragDisabled | 0x00000080 |
QTreeWidgetItemIterator::DropEnabled | 0x00000100 |
QTreeWidgetItemIterator::DropDisabled | 0x00000200 |
QTreeWidgetItemIterator::HasChildren | 0x00000400 |
QTreeWidgetItemIterator::NoChildren | 0x00000800 |
QTreeWidgetItemIterator::Checked | 0x00001000 |
QTreeWidgetItemIterator::NotChecked | 0x00002000 |
QTreeWidgetItemIterator::Enabled | 0x00004000 |
QTreeWidgetItemIterator::Disabled | 0x00008000 |
QTreeWidgetItemIterator::Editable | 0x00010000 |
QTreeWidgetItemIterator::NotEditable | 0x00020000 |
QTreeWidgetItemIterator::UserFlag | 0x01000000 |
QTreeWidgetItemIterator::QTreeWidgetItemIterator | ( | const QTreeWidgetItemIterator & | iter | ) |
Constructs an iterator for the same QTreeWidget as iter. The current iterator item is set to point on the current item of it.
|
explicit |
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 does not match the flags.
|
explicit |
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 does not match the flags.
QTreeWidgetItemIterator::~QTreeWidgetItemIterator | ( | ) |
Destroys the iterator.
|
inline |
Dereference operator. Returns a pointer to the current item.
QTreeWidgetItemIterator & QTreeWidgetItemIterator::operator++ | ( | ) |
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.
|
inline |
The postfix ++ operator (it++) advances the iterator to the next matching item and returns an iterator to the previously current item.
|
inline |
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.
QTreeWidgetItemIterator & QTreeWidgetItemIterator::operator-- | ( | ) |
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.
|
inline |
The postfix – operator (it–) makes the preceding matching item current and returns an iterator to the previously current item.
|
inline |
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.
QTreeWidgetItemIterator & QTreeWidgetItemIterator::operator= | ( | const QTreeWidgetItemIterator & | it | ) |
Assignment. Makes a copy of it and returns a reference to its iterator.