.BI "\fBQLayoutIterator\fR ( QGLayoutIterator * gi )"
.br
.ti -1c
.BI "\fBQLayoutIterator\fR ( const QLayoutIterator & i )"
.br
.ti -1c
.BI "\fB~QLayoutIterator\fR ()"
.br
.ti -1c
.BI "QLayoutIterator & \fBoperator=\fR ( const QLayoutIterator & i )"
.br
.ti -1c
.BI "QLayoutItem * \fBoperator++\fR ()"
.br
.ti -1c
.BI "QLayoutItem * \fBcurrent\fR ()"
.br
.ti -1c
.BI "QLayoutItem * \fBtakeCurrent\fR ()"
.br
.ti -1c
.BI "void \fBdeleteCurrent\fR ()"
.br
.in -1c
.SH DESCRIPTION
The QLayoutIterator class provides iterators over QLayoutItem.
.PP
Use QLayoutItem::iterator() to create an iterator over a layout.
.PP
QLayoutIterator uses \fIexplicit\fR sharing with a reference count. If an iterator is copied and one of the copies is modified, both iterators will be modified.
.PP
A QLayoutIterator is not protected against changes in its layout. If the layout is modified or deleted the iterator will become invalid. It is not possible to test for validity. It is safe to delete an invalid layout; any other access may lead to an illegal memory reference and the abnormal termination of the program.
.PP
Calling takeCurrent() or deleteCurrent() leaves the iterator in a valid state, but may invalidate any other iterators that access the same layout.
.PP
The following code will draw a rectangle for each layout item in the layout structure of the widget.
All the functionality of QLayoutIterator is implemented by subclasses of QGLayoutIterator. QLayoutIterator itself is not designed to be subclassed.
.PP
See also Widget Appearance and Style and Layout Management.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QLayoutIterator::QLayoutIterator ( QGLayoutIterator * gi )"
Constructs an iterator based on \fIgi\fR. The constructed iterator takes ownership of \fIgi\fR and will delete it.
.PP
This constructor is provided for layout implementors. Application programmers should use QLayoutItem::iterator() to create an iterator over a layout.
.SH "QLayoutIterator::QLayoutIterator ( const QLayoutIterator & i )"
Creates a shallow copy of \fIi\fR, i.e. if the copy is modified, then the original will also be modified.
.SH "QLayoutIterator::~QLayoutIterator ()"
Destroys the iterator.
.SH "QLayoutItem * QLayoutIterator::current ()"
Returns the current item, or 0 if there is no current item.
.SH "void QLayoutIterator::deleteCurrent ()"
Removes and deletes the current child item from the layout and moves the iterator to the next item. This iterator will still be valid, but any other iterator over the same layout may become invalid.