PDA

View Full Version : How to resize a Mdi child?



qlands
6th May 2010, 19:29
Hi,

I have an application that uses mdi childs. This childs are defined in the UI as 800x600 but when I create a new child the application sets it to 264x489.. And I don't see how to change this in code. I can resize them with the mouse though.

I tried resize(...) or setGeometry(...) but nothing works out.

Any idea what I am missing?

Thanks.

tbscope
6th May 2010, 20:05
If you want to set a minimum size, you can use setMinimumSize or setMinimumSizeHint.

harveyab
25th May 2016, 18:53
After much searching for an answer, and experimenting, I found this to work for me.



child->parentWidget()->resize(900, 700);
child->parentWidget()->updateGeometry();
child->show();
// child->showMaximized();

You can use showMaximized() in place of show() and the (900, 700) will still be used if the window is later changed to normal.