Logo Search packages:      
Sourcecode: qt4-x11 version File versions

src_gui_kernel_qlayout.cpp

//! [0]
static void paintLayout(QPainter *painter, QLayoutItem *item)
{
    QLayout *layout = item->layout();
    if (layout) {
        for (int i = 0; i < layout->count(); ++i)
            paintLayout(painter, layout->itemAt(i));
    }
    painter->drawRect(layout->geometry());
}

00012 void MyWidget::paintEvent(QPaintEvent *)
{
    QPainter painter(this);
    if (layout())
        paintLayout(&painter, layout());
}
//! [0]


//! [1]
QLayoutItem *child;
while ((child = layout->takeAt(0)) != 0) {
    ...
    delete child;
}
//! [1]

Generated by  Doxygen 1.6.0   Back to index