| Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date | |
| All threads index page 2 | |
Hi all, I find QT4's Designer to be a _great_ tool, so kudos to the trolls there. However, I keep struggling with the same kind of problem again and again. My problem is assosiated with layouts and getting widgets sizes according to my wishes. I'm sure the reason I can't get it to work is because I don't understand SizePolizy's etc completely. I have read the relevant parts of the manual, but I can't seem to figure it out anyway. So, here's what I want: A widget containing a GroupBox, TableWidget (inside the GroupBox) and a PushButton below the GroupBox. The PushButton should always be at the bottom, and should not get resized no matter if the widget is resized. The GroupBox should expand as the widget is expanded, and the TableWidget should also do so, so that it always fills the GroupBox. I have attached a .ui-file that people may load in Designer. I would be very grateful if someone were able to get the above to work, and could explain why what they did worked. :p Oh, and don't mind the values that are set right now, since they are probably all skewered. ;) Best, Christopher
Attachment:
Attachment:
mainwidgetwdg.ui
Description: Binary data
Message 2 in thread
Hi Christopher,
It seems you are lacking top level layouts.
Try that (from scratch):
1) Drop the group box, the push button and horizontal spacer on the form.
2) Select the button and the spacer (e.g with rubber band) and click "Lay Out
Horizontally" action (can be found in main toolbar). Button and spacer are
now inside "red layout".
3) Click the form _background_ to activate the form and click "Lay Out
Vertically" action. You should now have top level layout (you will not see
any new red frame for this layout).
4) Drop table inside group box, click group box background and click "Lay Out
Horizontally" - now table should be inside group box layout.
Hope it helps
Regards
Jarek
On Monday 06 August 2007 06:37, Christopher Rasch-Olsen Raa wrote:
> Hi all,
>
> I find QT4's Designer to be a _great_ tool, so kudos to the trolls there.
> However, I keep struggling with the same kind of problem again and again.
> My problem is assosiated with layouts and getting widgets sizes according
> to my wishes. I'm sure the reason I can't get it to work is because I don't
> understand SizePolizy's etc completely.
>
> I have read the relevant parts of the manual, but I can't seem to figure it
> out anyway.
>
> So, here's what I want:
> A widget containing a GroupBox, TableWidget (inside the GroupBox) and a
> PushButton below the GroupBox.
> The PushButton should always be at the bottom, and should not get resized
> no matter if the widget is resized.
> The GroupBox should expand as the widget is expanded, and the TableWidget
> should also do so, so that it always fills the GroupBox.
>
> I have attached a .ui-file that people may load in Designer. I would be
> very grateful if someone were able to get the above to work, and could
> explain why what they did worked. :p Oh, and don't mind the values that are
> set right now, since they are probably all skewered. ;)
>
> Best,
> Christopher
--
[ signature omitted ]
Message 3 in thread
Thankss all who replied,
As they say: "Assumption is the mother of all f*ck-ups".
I assumed that when you put one (and only one) widget into another widget that
some magic happened so the outer one got a layout. Silly me. :p
Well, it works now, and I'm pleased. Thanks guys and !guys.
--
[ signature omitted ]