Homepage > Man Pages > Category > Subroutines
Homepage > Man Pages > Name > Q

qlistviewitemiterator

man page of qlistviewitemiterator

qlistviewitemiterator: Iterator for collections of QListViewItems

NAME
QListViewItemIterator - Iterator for collections of QListViewItems
SYNOPSIS
#include <qlistview.h> Public Members 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 } QListViewItemIterator () QListViewItemIterator ( QListViewItem * item ) QListViewItemIterator ( QListViewItem * item, int iteratorFlags ) QListViewItemIterator ( const QListViewItemIterator & it ) QListViewItemIterator ( QListView * lv ) QListViewItemIterator ( QListView * lv, int iteratorFlags ) QListViewItemIterator & operator= ( const QListViewItemIterator & it ) ~QListViewItemIterator () QListViewItemIterator & operator++ () const QListViewItemIterator operator++ ( int ) QListViewItemIterator & operator+= ( int j ) QListViewItemIterator & operator-- () const QListViewItemIterator operator-- ( int ) QListViewItemIterator & operator-= ( int j ) QListViewItem * operator* () QListViewItem * current () const

DESCRIPTION

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. See also QListView, QListViewItem, and Advanced Widgets. Member Type Documentation

QLISTVIEWITEMITERATOR::ITERATORFLAG

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. QListViewItemIterator::Visible QListViewItemIterator::Invisible QListViewItemIterator::Selected QListViewItemIterator::Unselected QListViewItemIterator::Selectable QListViewItemIterator::NotSelectable QListViewItemIterator::DragEnabled QListViewItemIterator::DragDisabled QListViewItemIterator::DropEnabled QListViewItemIterator::DropDisabled QListViewItemIterator::Expandable QListViewItemIterator::NotExpandable QListViewItemIterator::Checked QListViewItemIterator::NotChecked

MEMBER FUNCTION DOCUMENTATION

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. See also 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. See also QListViewItemIterator::IteratorFlag.

QLISTVIEWITEMITERATOR::~QLISTVIEWITEMITERATOR ()

Destroys the iterator.
QLISTVIEWITEM * QLISTVIEWITEMITERATOR::CURRENT () CONST
Returns iterator's current item. Examples:
QLISTVIEWITEM * QLISTVIEWITEMITERATOR::OPERATOR* ()
Dereference operator. Returns a reference to the current item. The same as current().

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.

CONST QLISTVIEWITEMITERATOR QLISTVIEWITEMITERATOR::OPERATOR++ ( INT )

This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Postfix ++. Makes the next item the new current item and returns the item that was the current item.

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-- ()

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 )
This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Postfix --. Makes the previous item the new current item and returns the item that was the current item.
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 ) Assignment. Makes a copy of it and returns a reference to its iterator.

SEE ALSO

//doc.trolltech.com/qlistviewitemiterator.html //www.trolltech.com/faq/tech.html

COPYRIGHT

Copyright 1992-2007 Trolltech ASA, //www.trolltech.com. See the license file included in the distribution for a complete license statement.

AUTHOR

Generated automatically from the source code.
BUGS
If you find a bug in Qt, please report it as described in //doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt- bugs@trolltech.com. Please include the name of the manual page (qlistviewitemiterator.3qt) and the Qt version (3.3.8). QLISTVIEWITEMITERATOR(3)
 
 
 

Copyright © 2011–2018 by topics-of-interest.com . All rights reserved. Hosted by all-inkl.
Contact · Imprint · Privacy

Page generated in 32.62ms.

schuhefinden.de | information-information.de | roboter.name