PDA

View Full Version : Resizing a top level widget to be greater than 2/3 of desktop size



zenzero-2001
29th April 2010, 14:19
Hello,

I have a main window consisting of a central widget, toolbar, statusbar and dock widgets. Under some circumstances I wish the central widget to dictate the size of the main window, I wish to specify the size of the central widget and not have it implicitly resized by Qt.

I have partially achieved this by reimplementing sizeHint() in my widget class, it returns the desired size, which I set with another member method. This works fine until I wish to have a widget size that is greater than 2/3 of the desktop size. Specifying such a widget size results in the widget being resized to 2/3 of the desktop size.

In the Qt documentation for QWidget, under Size Hints and Size Policies it states:


Note: The size of top-level widgets are constrained to 2/3 of the desktop's height and width. You can resize() the widget manually if these bounds are inadequate.

I have tried using the resize method of my widget before showing the main window but it does not work. I do not want to perform the resize after showing the main window. Does anybody have any ideas how to circumvent this limitation? Any help much appreciated, thanks!

Regards,

zenzero-2001