PDA

View Full Version : QMdiSubWindow maximizing problem



hgedek
7th September 2011, 16:00
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 ?



QMdiSubWindow* subWindow = mdiArea->addSubWindow(view,Qt::SubWindow);
subWindow->setOption(QMdiSubWindow::RubberBandResize, true);
subWindow->setOption(QMdiSubWindow::SubWindowOption::AllowOut sideAreaHorizontally, false);
subWindow->setOption(QMdiSubWindow::SubWindowOption::AllowOut sideAreaVertically, false);
subWindow->setAttribute(Qt::WA_DeleteOnClose);
subWindow->showMaximized();

ChrisW67
7th September 2011, 23:19
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:


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.