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

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 573 of file qmainwindow.cpp.

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

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

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index