PDA

View Full Version : Main Window Size not Scaled Properly



alok9871
11th January 2013, 07:24
I have a very elementary problem and I think answer is going to be as simple only. But I seem not to hit it right.

I had designed my mainwindow with multiple widgets and buttons.

The Problem is that when I try to maximise it or use showMaximized(), all the items move to the left top side and does not scale to the whole page. How do i correct it?

Please help.

Thank You

Santosh Reddy
11th January 2013, 07:58
What are the widgets, and what size policies are set on them?

ChrisW67
11th January 2013, 08:10
My guess is you are missing a layout on your main window

alok9871
11th January 2013, 08:21
@Santosh : Just some combo boxes and list boxes and some buttons.

@ ChrisW67 Guru : I know the problem may lie somewhere around that because a similar problem came up in the stackoverflow.com and had similar solution. But I couldnt quite follow the concept. I just dragged the items onto the mainWindow.ui and started working. In fact, I am quite far ahead with it. Can you please help me a way out of this problem? Many thanks

Santosh Reddy
11th January 2013, 08:35
What Layout did you set on the MainWidow? Try setting QGridLayout (Right Click->"Lay out"->"Lay out in Grid"):cool:

alok9871
11th January 2013, 09:08
Thanks Santosh!!

It works!! :). But it also re-arranges my widgets on the screen which doesn't look good. Any way out?

Santosh Reddy
11th January 2013, 09:34
You could use somthing like spacers (Horizontal / Vertical), to adjust the spacing between widgets, and restricting the widgets from growing.

For better understanding read documentation of QGridLayout

ChrisW67
13th January 2013, 22:18
More generally, read the information at Layout Management and how to use this in Designer.