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

void QMainWindow::setCentralWidget ( QWidget widget  )  [inherited]

Sets the given widget to be the main window's central widget.

Note: QMainWindow takes ownership of the widget pointer and deletes it at the appropriate time.

See also:
centralWidget()

Definition at line 570 of file qmainwindow.cpp.

Referenced by ImageViewer::ImageViewer(), MainWindow::MainWindow(), MainWindow::setupUi(), and TextEdit().

{
    Q_D(QMainWindow);
    if (d->layout->centralWidget() && d->layout->centralWidget() != widget) {
        d->layout->centralWidget()->hide();
        d->layout->centralWidget()->deleteLater();
    }
    d->layout->setCentralWidget(widget);
}


Generated by  Doxygen 1.6.0   Back to index