PDA

View Full Version : Letting the Layout fill the whole area of the parent



draGy
18th December 2008, 18:33
Hi,
I am new to Qt and I am using the Qt Creator.
I was wonderin how I can set a layout into a Frame/Widget (e.g. Tab Widget) which automatically expands to the widgets size?
Like the Top Level Layouts do.

When I place a Layout on a Frame/Widget the layout always has a fixed size and if I resize the Widget/Frame the layout does not resize equally. It stays static.

Isnt there a way to tell the Layout that it should always take the same size as the parent Frame/Widget has?

Basically just want the layouts to behave like the top level layouts behave when they are on the mainwindow.

jpn
18th December 2008, 19:14
Click on the background of the tab and choose a layout for example from the toolbar or context menu.

draGy
18th December 2008, 19:33
Once I clicked on the background (and thus selected the tab widget) the layouts on the tool bar are disabled. And from the the context menu (which for me is the rightclick menu) doesnt provide any layouts.
And clicking on the Menu where all the widgets/layouts, etc are available doesnt do anything. I have to drag the layout into the tab widget. But once dragged in it has a fixed size. I can resize it, but it will stay fix independed from the size of the tab window.

jpn
18th December 2008, 19:52
Can you attach the .ui file?

draGy
18th December 2008, 20:16
Here is the .ui File

jpn
18th December 2008, 20:32
Here it is with a layout installed like I described above:

draGy
18th December 2008, 21:16
Thx mate.
AlthoughI couldnt understand why it worked with you and not with me, I do know now.

My Problem was that I tried to put a layout on the tab before it had any widgets in it. But it only works once there is one widget in it. Then the layouts on the toolbar are enabled.

Thank you for helping (especially that fast).