Eneboo - Documentación para desarrolladores
Métodos públicos
Referencia de la Clase QLayoutIterator

The QLayoutIterator class provides iterators over QLayoutItem. Más...

#include <qlayout.h>

Lista de todos los miembros.

Métodos públicos

 QLayoutIterator (QGLayoutIterator *i)
 QLayoutIterator (const QLayoutIterator &i)
 ~QLayoutIterator ()
QLayoutIteratoroperator= (const QLayoutIterator &i)
QLayoutItemoperator++ ()
QLayoutItemcurrent ()
QLayoutItemtakeCurrent ()
void deleteCurrent ()
 QLayoutIterator (QGLayoutIterator *i)
 QLayoutIterator (const QLayoutIterator &i)
 ~QLayoutIterator ()
QLayoutIteratoroperator= (const QLayoutIterator &i)
QLayoutItemoperator++ ()
QLayoutItemcurrent ()
QLayoutItemtakeCurrent ()
void deleteCurrent ()

Descripción detallada

The QLayoutIterator class provides iterators over QLayoutItem.

Use QLayoutItem::iterator() to create an iterator over a layout.

QLayoutIterator uses explicit sharing with a reference count. If an iterator is copied and one of the copies is modified, both iterators will be modified.

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.

Calling takeCurrent() or deleteCurrent() leaves the iterator in a valid state, but may invalidate any other iterators that access the same layout.

The following code will draw a rectangle for each layout item in the layout structure of the widget.

    static void paintLayout( QPainter *p, QLayoutItem *lay )
    {
        QLayoutIterator it = lay->iterator();
        QLayoutItem *child;
        while ( (child = it.current()) != 0 ) {
            paintLayout( p, child );
            ++it;
        }
        p->drawRect( lay->geometry() );
    }
    void ExampleWidget::paintEvent( QPaintEvent * )
    {
        QPainter p( this );
        if ( layout() )
            paintLayout( &p, layout() );
    }

All the functionality of QLayoutIterator is implemented by subclasses of QGLayoutIterator. QLayoutIterator itself is not designed to be subclassed.


Documentación del constructor y destructor

QLayoutIterator::QLayoutIterator ( QGLayoutIterator gi) [inline]

Constructs an iterator based on gi. The constructed iterator takes ownership of gi and will delete it.

This constructor is provided for layout implementors. Application programmers should use QLayoutItem::iterator() to create an iterator over a layout.

QLayoutIterator::QLayoutIterator ( const QLayoutIterator i) [inline]

Creates a shallow copy of i, i.e. if the copy is modified, then the original will also be modified.

QLayoutIterator::~QLayoutIterator ( ) [inline]

Destroys the iterator.

QLayoutIterator::QLayoutIterator ( QGLayoutIterator i) [inline]
QLayoutIterator::QLayoutIterator ( const QLayoutIterator i) [inline]
QLayoutIterator::~QLayoutIterator ( ) [inline]

Documentación de las funciones miembro

QLayoutItem * QLayoutIterator::current ( ) [inline]

Returns the current item, or 0 if there is no current item.

QLayoutItem* QLayoutIterator::current ( ) [inline]
void QLayoutIterator::deleteCurrent ( ) [inline]

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.

void QLayoutIterator::deleteCurrent ( )
QLayoutItem* QLayoutIterator::operator++ ( ) [inline]
QLayoutItem * QLayoutIterator::operator++ ( ) [inline]

Moves the iterator to the next child item and returns that item, or 0 if there is no such item.

QLayoutIterator & QLayoutIterator::operator= ( const QLayoutIterator i) [inline]

Assigns i to this iterator and returns a reference to this iterator.

QLayoutIterator& QLayoutIterator::operator= ( const QLayoutIterator i) [inline]
QLayoutItem * QLayoutIterator::takeCurrent ( ) [inline]

Removes the current child item from the layout without deleting it, and moves the iterator to the next item. Returns the removed item, or 0 if there was no item to be removed. This iterator will still be valid, but any other iterator over the same layout may become invalid.

QLayoutItem* QLayoutIterator::takeCurrent ( ) [inline]

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'