Sorry, guys about that, my mistake. OK, here is the code:
foreach(QMdiSubWindow *sub, this->mdiWin->subWindowList())
{
if(sub->isActiveWindow())
{
sub->close();
break;
}
}
foreach(QMdiSubWindow *sub, this->mdiWin->subWindowList())
{
if(sub->isActiveWindow())
{
sub->close();
break;
}
}
To copy to clipboard, switch view to plain text mode
So in this case the window, which was opened first, will be closed, even it's not an active window. In this code "this" - is window, which central widget is MdiArea's object (mdiWin). In each sub-window we have a simple widget, let's say, PushButton.
Bookmarks