QIntDictIterator(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’– 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 destructor
  • uint count () const β€” how many items are in there
  • bool isEmpty () const β€” is it empty or nah
  • type * toFirst () β€” jump back to the first item
  • operator type * () const β€” cast operator
  • type * current () const β€” the current item, pls
  • long currentKey () const β€” the key of the current item
  • type * operator() () β€” moves forward, returns the old current
  • type * operator++ () β€” prefix ++, moves forward, returns the new current
  • type * operator+= ( uint jump ) β€” skip ahead jump positions

πŸ¦‹ 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 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