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

void QWidget::setLayout ( QLayout layout  )  [inherited]

Sets the layout manager for this widget to layout.

If there already is a layout manager installed on this widget, QWidget won't let you install another. You must first delete the existing layout manager (returned by layout()) before you can call setLayout() with the new layout.


tutorial/t10/lcdrange.cpp = new QVBoxLayout setLayout

An alternative to calling this function is to pass this widget to the layout's constructor.

The QWidget will take ownership of layout.

See also:
layout(), {Layout Classes}

Definition at line 7364 of file qwidget.cpp.

References QByteArray::data(), QLayout::invalidate(), QLayout::layout(), QWidget::layout(), QObject::objectName, QObject::parent(), QObject::setParent(), and QString::toLocal8Bit().

Referenced by QLayout::QLayout(), and QMdiSubWindow::QMdiSubWindow().

    if (!l) {
        qWarning("QWidget::setLayout: Cannot set layout to 0");
    if (layout()) {
        if (layout() != l)
            qWarning("QWidget::setLayout: Attempting to add QLayout \"%s\" to %s \"%s\", which already has a"
                     " layout", l->objectName().toLocal8Bit().data(), metaObject()->className(),
    l->d_func()->topLevel = true;
    d_func()->layout = l;
    if (l->parent() != this) {

Generated by  Doxygen 1.6.0   Back to index