Logo Search packages:      
Sourcecode: qt4-x11 version File versions

Q3ListViewItemIterator Class Reference

List of all members.


Detailed Description

The Q3ListViewItemIterator class provides an iterator for collections of Q3ListViewItems.

Construct an instance of a Q3ListViewItemIterator, with either a Q3ListView* or a Q3ListViewItem* as argument, to operate on the tree of Q3ListViewItems, starting from the argument.

A Q3ListViewItemIterator iterates over all the items from its starting point. This means that it always makes the first child of the current item the new current item. If there is no child, the next sibling becomes the new current item; and if there is no next sibling, the next sibling of the parent becomes current.

The following example creates a list of all the items that have been selected by the user, storing pointers to the items in a QList: doc/src/snippets/code/src_qt3support_itemviews_q3listview.cpp 6

An alternative approach is to use an IteratorFlag: doc/src/snippets/code/src_qt3support_itemviews_q3listview.cpp 7

A Q3ListViewItemIterator provides a convenient and easy way to traverse a hierarchical Q3ListView.

Multiple Q3ListViewItemIterators can operate on the tree of Q3ListViewItems. A Q3ListView knows about all iterators operating on its Q3ListViewItems. So when a Q3ListViewItem gets removed all iterators that point to this item are updated and point to the following item if possible, otherwise to a valid item before the current one or to 0. Note however that deleting the parent item of an item that an iterator points to is not safe.

See also:
Q3ListView, Q3ListViewItem

Definition at line 540 of file q3listview.h.


Public Types

enum  IteratorFlag {
  Visible = 0x00000001, Invisible = 0x00000002, Selected = 0x00000004, Unselected = 0x00000008,
  Selectable = 0x00000010, NotSelectable = 0x00000020, DragEnabled = 0x00000040, DragDisabled = 0x00000080,
  DropEnabled = 0x00000100, DropDisabled = 0x00000200, Expandable = 0x00000400, NotExpandable = 0x00000800,
  Checked = 0x00001000, NotChecked = 0x00002000
}

Public Member Functions

Q3ListViewItemcurrent () const
Q3ListViewItemoperator* ()
const Q3ListViewItemIterator operator++ (int)
Q3ListViewItemIteratoroperator++ ()
Q3ListViewItemIteratoroperator+= (int j)
const Q3ListViewItemIterator operator-- (int)
Q3ListViewItemIteratoroperator-- ()
Q3ListViewItemIteratoroperator-= (int j)
Q3ListViewItemIteratoroperator= (const Q3ListViewItemIterator &it)
 Q3ListViewItemIterator (Q3ListView *lv, int iteratorFlags)
 Q3ListViewItemIterator (Q3ListView *lv)
 Q3ListViewItemIterator (const Q3ListViewItemIterator &it)
 Q3ListViewItemIterator (Q3ListViewItem *item, int iteratorFlags)
 Q3ListViewItemIterator (Q3ListViewItem *item)
 Q3ListViewItemIterator ()
 ~Q3ListViewItemIterator ()

Private Member Functions

void currentRemoved ()
bool isChecked (const Q3ListViewItem *) const
bool matchesFlags (const Q3ListViewItem *) const
bool testPair (Q3ListViewItemIterator::IteratorFlag, Q3ListViewItemIterator::IteratorFlag, bool) const

Private Attributes

Q3ListViewItemcurr
int flags
Q3ListViewlistView

Friends

class Q3ListView
class Q3ListViewItem
struct Q3ListViewPrivate

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index