2
votes

I am trying to close an MDI child (MainWindow is its parent), and I just cannot make it happen. All that is happening, is that all controls are getting removed from the MDI child, but the actually window is not getting removed from the 'mdiArea'.

With my QDialog (the MDI child), I call close. That didn't work, so as well as calling close, I also tried calling:

ui->mdiArea->removeSubWindow(mdiChildDialog);

Again, same results: enter image description here

Thanks in advanced.

1
Alright, I got it to remove a single one, but once another instance of the same window is created, the other one is shown again: i.imgur.com/PFdMB.pnghetelek

1 Answers

3
votes

try ... this->parentWidget()->close(); to close the child mdi.