QIntDictIterator(3qt)
π QIntDictIterator π
okay so bestie, welcome to QIntDictIterator(3qt) β yep, that's a Qt 3 manual page, section 3qt, and it's all about iterating over QIntDict collections. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
QIntDictIterator β literally an iterator for QIntDict collections. that's it, that's the whole job description π
πΈ SYNOPSIS πΈ
#include <qintdict.h>
π Public Members π
QIntDictIterator ( const QIntDict<type> & dict )β the constructor, takes the dict you wanna walk through~QIntDictIterator ()β the destructoruint count () constβ how many items are in therebool isEmpty () constβ is it empty or nahtype * toFirst ()β jump back to the first itemoperator type * () constβ cast operatortype * current () constβ the current item, plslong currentKey () constβ the key of the current itemtype * operator() ()β moves forward, returns the old currenttype * operator++ ()β prefix++, moves forward, returns the new currenttype * operator+= ( uint jump )β skip aheadjumppositions
π¦ DESCRIPTION π¦
The QIntDictIterator class provides an iterator for QIntDict collections. no cap, that's the whole vibe. π§
QIntDictIterator is implemented as a template class. Define a template instance QIntDictIterator<X> to create a dictionary iterator that operates on QIntDict<X> (dictionary of X*).
Example, and yes it's iconic:
QIntDict<QLineEdit> fields;
for ( int i = 0; i < 3; i++ )
fields.insert( i, new QLineEdit( this ) );
fields[0]->setText( "Homer" );
fields[1]->setText( "Simpson" );
fields[2]->setText( "45" );
QIntDictIterator<QLineEdit> it( fields );
for ( ; it.current(); ++it )
cout << it.currentKey() << ": " << it.current()->text() << endl;
// Output (random order):
// 0: Homer
// 1: Simpson
// 2: 45
β οΈ bestie listen: the traversal order is arbitrary. you are not guaranteed the order shown above. do not build your whole personality on that output order, i'm begging π
Multiple iterators may independently traverse the same dictionary. A QIntDict knows about all the iterators that are operating on the dictionary. When an item is removed from the dictionary, QIntDict updates all iterators that refer the removed item to point to the next item in the traversal order. that's the self-care right there π
See also QIntDict, Collection Classes, and Non-GUI Classes.
π MEMBER FUNCTION DOCUMENTATION π
QIntDictIterator::QIntDictIterator ( const QIntDict<type> & dict )
Constructs an iterator for dict. The current iterator item is set to point to the 'first' item in the dict. The first item refers to the first item in the dictionary's arbitrary internal ordering. (yes, arbitrary. we don't ask questions, we just vibe.) π
QIntDictIterator::~QIntDictIterator ()
Destroys the iterator. bye bestie ππ
uint QIntDictIterator::count () const
Returns the number of items in the dictionary this iterator operates over.
See also isEmpty().
type * QIntDictIterator::current () const
Returns a pointer to the current iterator item.
long QIntDictIterator::currentKey () const
Returns the key for the current iterator item.
bool QIntDictIterator::isEmpty () const
Returns TRUE if the dictionary is empty; otherwise returns FALSE.
See also count().
QIntDictIterator::operator type * () const
Cast operator. Returns a pointer to the current iterator item. Same as current().
type * QIntDictIterator::operator() ()
Makes the succeeding item current and returns the original current item.
If the current iterator item was the last item in the dictionary or if it was 0, 0 is returned. π«
type * QIntDictIterator::operator++ ()
Prefix ++ makes the succeeding item current and returns the new current item.
If the current iterator item was the last item in the dictionary or if it was 0, 0 is returned.
type * QIntDictIterator::operator+= ( uint jump )
Sets the current item to the item jump positions after the current item, and returns a pointer to that item.
If that item is beyond the last item or if the dictionary is empty, it sets the current item to 0 and returns 0.
type * QIntDictIterator::toFirst ()
Sets the current iterator item to point to the first item in the dictionary and returns a pointer to the item. The first item refers to the first item in the dictionary's arbitrary internal ordering. If the dictionary is empty it sets the current item to 0 and returns 0. π«
π₯ SEE ALSO π₯
π COPYRIGHT π
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.
π AUTHOR π
Generated automatically from the source code. (so nobody gets to take credit, tragic honestly π)
π BUGS π
If you find a bug in Qt, please report it as described in http://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 (qintdictiterator.3qt) and the Qt version (3.3.8).
and that's the whole page, periodt π this one came to you from Trolltech AS, dated 2 February 2007, riding along with Qt version 3.3.8. go iterate responsibly, bestie π¦β¨
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms