View Full Version : QMdiArea subwindow size always minimized

15th July 2012, 22:42
I currently have a QMainWindow with a QMdiArea as the central widget. I have a method that adds a subwindow to the QMdiArea. When it appears, it's width and height are always at it's minimum value (you only see the icon and Min,Max,Close buttons). The subwindow that is being added is a qwidget with a size of 640x480 which is sized with resize() in its constructor. I thought this would size the QSubWindow to the size of that widget but it does not work. Why is this?

Only setting specific numbers works by getting a handle on the currentSubWindow: mdiArea->currentSubWindow()->resize( 640, 480 );

EDIT: It seems that the widget that you add to the subwindow is resized to something like 111, -18. Any suggestions on how to get the subwindow size to be the size of its internal widget?

EDIT: I've found an acceptable solution. Use setMinimumSize and call adjustSize. https://bugreports.qt-project.org/browse/QTBUG-5825