QMdiSubWindow maximizing problem
I want to show widgets in an mdi area..and when i maximized it, it passes borders of this area and filling all the are of the main window...I mean it should just fill the mdiarea borders - area just but not ..
what can i do or what am i doing wrongly ?
Code:
QMdiSubWindow* subWindow = mdiArea->addSubWindow(view,Qt::SubWindow);
subWindow->setOption(QMdiSubWindow::RubberBandResize, true);
subWindow->setOption(QMdiSubWindow::SubWindowOption::AllowOutsideAreaHorizontally, false);
subWindow->setOption(QMdiSubWindow::SubWindowOption::AllowOutsideAreaVertically, false);
subWindow->setAttribute(Qt::WA_DeleteOnClose);
subWindow->showMaximized();
Re: QMdiSubWindow maximizing problem
That is how maximised MDI child windows have worked on Windows (and elsewhere) for a long time. If you don't want the MDI child maximised then don't maximise it. I guess you could determine the size of the MDI area viewport and set that on the child window after intercepting the window state change:
Quote:
When the window state changes, the widget receives a changeEvent() of type QEvent::WindowStateChange.
I have not tried that though.
BTW: AllowOutsideAreaHorizontally and AllowOutsideAreaVertically are both undocumented and marked "internal" in the relevant header file.