Eneboo - Documentación para desarrolladores
Tipos públicos | Métodos públicos | Atributos protegidos | Amigas
Referencia de la Clase QListViewItemIterator

The QListViewItemIterator class provides an iterator for collections of QListViewItems. Más...

#include <qlistview.h>

Lista de todos los miembros.

Tipos públicos

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

Métodos públicos

 QListViewItemIterator ()
 QListViewItemIterator (QListViewItem *item)
 QListViewItemIterator (QListViewItem *item, int iteratorFlags)
 QListViewItemIterator (const QListViewItemIterator &it)
 QListViewItemIterator (QListView *lv)
 QListViewItemIterator (QListView *lv, int iteratorFlags)
QListViewItemIteratoroperator= (const QListViewItemIterator &it)
 ~QListViewItemIterator ()
QListViewItemIteratoroperator++ ()
const QListViewItemIterator operator++ (int)
QListViewItemIteratoroperator+= (int j)
QListViewItemIteratoroperator-- ()
const QListViewItemIterator operator-- (int)
QListViewItemIteratoroperator-= (int j)
QListViewItemoperator* ()
QListViewItemcurrent () const
 QListViewItemIterator ()
 QListViewItemIterator (QListViewItem *item)
 QListViewItemIterator (QListViewItem *item, int iteratorFlags)
 QListViewItemIterator (const QListViewItemIterator &it)
 QListViewItemIterator (QListView *lv)
 QListViewItemIterator (QListView *lv, int iteratorFlags)
QListViewItemIteratoroperator= (const QListViewItemIterator &it)
 ~QListViewItemIterator ()
QListViewItemIteratoroperator++ ()
const QListViewItemIterator operator++ (int)
QListViewItemIteratoroperator+= (int j)
QListViewItemIteratoroperator-- ()
const QListViewItemIterator operator-- (int)
QListViewItemIteratoroperator-= (int j)
QListViewItemoperator* ()
QListViewItemcurrent () const

Atributos protegidos

QListViewItemcurr
QListViewlistView

Amigas

struct QListViewPrivate
class QListView
class QListViewItem

Descripción detallada

The QListViewItemIterator class provides an iterator for collections of QListViewItems.

Construct an instance of a QListViewItemIterator, with either a QListView* or a QListViewItem* as argument, to operate on the tree of QListViewItems, starting from the argument.

A QListViewItemIterator 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 QPtrList:

    QPtrList<QListViewItem> lst;
    QListViewItemIterator it( myListView );
    while ( it.current() ) {
        if ( it.current()->isSelected() )
            lst.append( it.current() );
        ++it;
    }

An alternative approach is to use an IteratorFlag:

    QPtrList<QListViewItem> lst;
    QListViewItemIterator it( myListView, QListViewItemIterator::Selected );
    while ( it.current() ) {
        lst.append( it.current() );
        ++it;
    }

A QListViewItemIterator provides a convenient and easy way to traverse a hierarchical QListView.

Multiple QListViewItemIterators can operate on the tree of QListViewItems. A QListView knows about all iterators operating on its QListViewItems. So when a QListViewItem 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.

Ver también:
QListView, QListViewItem

Documentación de las enumeraciones miembro de la clase

These flags can be passed to a QListViewItemIterator constructor (OR-ed together if more than one is used), so that the iterator will only iterate over items that match the given flags.

Visible Invisible Selected Unselected Selectable NotSelectable DragEnabled DragDisabled DropEnabled DropDisabled Expandable NotExpandable Checked NotChecked

Valores de enumeraciones:
Visible 
Invisible 
Selected 
Unselected 
Selectable 
NotSelectable 
DragEnabled 
DragDisabled 
DropEnabled 
DropDisabled 
Expandable 
NotExpandable 
Checked 
NotChecked 
Visible 
Invisible 
Selected 
Unselected 
Selectable 
NotSelectable 
DragEnabled 
DragDisabled 
DropEnabled 
DropDisabled 
Expandable 
NotExpandable 
Checked 
NotChecked 
Valores de enumeraciones:
Visible 
Invisible 
Selected 
Unselected 
Selectable 
NotSelectable 
DragEnabled 
DragDisabled 
DropEnabled 
DropDisabled 
Expandable 
NotExpandable 
Checked 
NotChecked 
Visible 
Invisible 
Selected 
Unselected 
Selectable 
NotSelectable 
DragEnabled 
DragDisabled 
DropEnabled 
DropDisabled 
Expandable 
NotExpandable 
Checked 
NotChecked 

Documentación del constructor y destructor

QListViewItemIterator::QListViewItemIterator ( )

Constructs an empty iterator.

QListViewItemIterator::QListViewItemIterator ( QListViewItem item)

Constructs an iterator for the QListView that contains the item. The current iterator item is set to point to the item.

QListViewItemIterator::QListViewItemIterator ( QListViewItem item,
int  iteratorFlags 
)

Constructs an iterator for the QListView that contains the item using the flags iteratorFlags. The current iterator item is set to point to item or the next matching item if item doesn't match the flags.

Ver también:
QListViewItemIterator::IteratorFlag
QListViewItemIterator::QListViewItemIterator ( const QListViewItemIterator it)

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

QListViewItemIterator::QListViewItemIterator ( QListView lv)

Constructs an iterator for the QListView lv. The current iterator item is set to point on the first child (QListViewItem) of lv.

QListViewItemIterator::QListViewItemIterator ( QListView lv,
int  iteratorFlags 
)

Constructs an iterator for the QListView lv with the flags iteratorFlags. The current iterator item is set to point on the first child (QListViewItem) of lv that matches the flags.

Ver también:
QListViewItemIterator::IteratorFlag
QListViewItemIterator::~QListViewItemIterator ( )

Destroys the iterator.

QListViewItemIterator::QListViewItemIterator ( )
QListViewItemIterator::QListViewItemIterator ( QListViewItem item)
QListViewItemIterator::QListViewItemIterator ( QListViewItem item,
int  iteratorFlags 
)
QListViewItemIterator::QListViewItemIterator ( const QListViewItemIterator it)
QListViewItemIterator::QListViewItemIterator ( QListView lv)
QListViewItemIterator::QListViewItemIterator ( QListView lv,
int  iteratorFlags 
)
QListViewItemIterator::~QListViewItemIterator ( )

Documentación de las funciones miembro

QListViewItem * QListViewItemIterator::current ( ) const

Returns iterator's current item.

QListViewItem* QListViewItemIterator::current ( ) const
QListViewItem * QListViewItemIterator::operator* ( )

Dereference operator. Returns a reference to the current item. The same as current().

QListViewItem* QListViewItemIterator::operator* ( )
QListViewItemIterator & QListViewItemIterator::operator++ ( )

Prefix ++. Makes the next item the new current item and returns it. Returns 0 if the current item is the last item or the QListView is 0.

QListViewItemIterator& QListViewItemIterator::operator++ ( )
const QListViewItemIterator QListViewItemIterator::operator++ ( int  )

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Postfix ++. Makes the next item the new current item and returns the item that was the current item.

const QListViewItemIterator QListViewItemIterator::operator++ ( int  )
QListViewItemIterator & QListViewItemIterator::operator+= ( int  j)

Sets the current item to the item j positions after the current item. If that item is beyond the last item, the current item is set to 0. Returns the current item.

QListViewItemIterator& QListViewItemIterator::operator+= ( int  j)
QListViewItemIterator & QListViewItemIterator::operator-- ( )

Prefix --. Makes the previous item the new current item and returns it. Returns 0 if the current item is the first item or the QListView is 0.

const QListViewItemIterator QListViewItemIterator::operator-- ( int  )
QListViewItemIterator& QListViewItemIterator::operator-- ( )
const QListViewItemIterator QListViewItemIterator::operator-- ( int  )

Esta es una función miembro sobrecargada que se suministra por conveniencia. Difiere de la anterior función solamente en los argumentos que acepta. Postfix --. Makes the previous item the new current item and returns the item that was the current item.

QListViewItemIterator& QListViewItemIterator::operator-= ( int  j)
QListViewItemIterator & QListViewItemIterator::operator-= ( int  j)

Sets the current item to the item j positions before the current item. If that item is before the first item, the current item is set to 0. Returns the current item.

QListViewItemIterator& QListViewItemIterator::operator= ( const QListViewItemIterator it)
QListViewItemIterator & QListViewItemIterator::operator= ( const QListViewItemIterator it)

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


Documentación de las funciones relacionadas y clases amigas

QListView [friend]
QListViewItem [friend]
QListViewPrivate [friend]

Documentación de los datos miembro


La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'