PDA

View Full Version : problem while resizing mainwindow.



phillip_Qt
9th November 2009, 13:40
in my main window i've 5 lables in a horaizenatllayout. all lable sizepolicy are setting to Prefered.
in my ctor i did like

ui->horizontalLayout->setSizeConstraint(QLayout::SetDefaultConstraint);
But the lables size are not resizing with the main window.
I've attched the ui. plz help me how to solve it. Thank u all.

yogeshgokul
9th November 2009, 13:51
But the lables size are not resizing with the main window.
You have forgot to add a main layout of the dialog, I corrected that. Please see the attched UI file.

phillip_Qt
10th November 2009, 05:01
You have forgot to add a main layout of the dialog, I corrected that. Please see the attched UI file.

Thank you veru much. It worked perfectly. Can u plz tell me how to add main layout using designer.?

yogeshgokul
10th November 2009, 05:35
Thank you veru much. It worked perfectly. Can u plz tell me how to add main layout using designer.?
Its easy, just right the widget/dialog/mainWindow (what ever you are designing using designer) and select any layout from submenu or use keyboard shortcuts.;)

phillip_Qt
10th November 2009, 06:28
Its easy, just right the widget/dialog/mainWindow (what ever you are designing using designer) and select any layout from submenu or use keyboard shortcuts.;)

Thank u yogesh. But i problem i faced like once i've added the layout i cannt change the size of widget i'm adding to the main window. i 've 2 add a tree widget in left hand side and a group box in right side like i've added in the attched one. can u plz chk it out, how to do so?

yogeshgokul
10th November 2009, 07:15
Thank u yogesh. But i problem i faced like once i've added the layout i cannt change the size of widget i'm adding to the main window. i 've 2 add a tree widget in left hand side and a group box in right side like i've added in the attched one. can u plz chk it out, how to do so?
You should add the main lay out at the last of your design.
Steps:
1. Create an empty dialog.
2. Add few widgets to it by dragging and dropping.
3. Add those widgets in some layout, lets say in grid layout.
4. At last, right click on dialog and select a layout. This layout will be the main layout of the dialog and should be added at last only.
Please clean your hands on Qt-Designer, do some more practice, its a great tool. :)

phillip_Qt
10th November 2009, 09:13
You should add the main lay out at the last of your design.
Steps:
1. Create an empty dialog.
2. Add few widgets to it by dragging and dropping.
3. Add those widgets in some layout, lets say in grid layout.
4. At last, right click on dialog and select a layout. This layout will be the main layout of the dialog and should be added at last only.
Please clean your hands on Qt-Designer, do some more practice, its a great tool. :)

Hi Yogesh.
Thanx 4 quick reply. I tried the way 2 told, but still its not working. Can u plz chk the attched attched ui?

phillip_Qt
10th November 2009, 09:44
Thank yoy Yogesh. I sorted out this problem. Thank u very much.