QMdiSubWindow close problem

  • Hello!

    I work on an IDE and I use QMdiArea and QMdiSubwindow to display textEdit area and Diagram Area as you can see in screen below:


    I used the following snippet of code to activate close buttons:

    Q_FOREACH (QTabBar* tab, ui->mdiArea->findChildren<QTabBar*>())

    And also the are two classes derived from QMdiSubWindow, one for diagram and one for TextEditor.
    For diagram DeleteOnClose is not a option because I only need it to hide, so I re-implemented QMdiSubWindow::closeEvent(QCloseEvent):

    void MdiDiagram::closeEvent(QCloseEvent *closeEvent)
    visible = false;
    where mdiParent is QMdiArea

    When I have multiple Editor tabs + diagram and try to close Diagram Window:


    everything turns up like this:


    and Editor Windows return to initial state if I press maximize button.

    How can I avoid this behavior, or how can I set the rest of windows to be maximized again?

Log in to reply

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