[Solved] QMdiArea simple question

  • Hi,
    I have a QMdiArea defined in a QMainWindow. I have several QWidgets defined and i want to add these widgets to my QMdiArea.I am unable to figure out how to create a layout and add the widgets to my QMdiArea.


    void MainWindow::createDockWindows()
    QDockWidget *dock = new QDockWidget(tr("Graphs"), this);
    dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);

    mdiArea = new QMdiArea;
    addDockWidget(Qt::RightDockWidgetArea, dock);


    void MainWindow::addGraph()
    QMdiSubWindow* subWindow = new QMdiSubWindow();
    internalCgWidget = new CallgraphWidget;
    qDebug() << "Added";

    I get the message "Added" but it does not show up in my QMdiArea. Where am i going wrong can someone give a simple code snippet to help.

    I appreciate your help.

  • Try subWindow->show().

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.