Anchoring the widgets for resizing with the form
-
Adding a layout to the UI elements on a form resizes and rearranges them all and it is not possible to change their sizes once they are in a layout. How's that powerful and flexible?
@nulluse
The layout define the size.Not reversed.
If you dont want the layout size for all widgets ,
u can then adjust with min/max sizes on individual widgets.
You can also instruct layout if u want to be greedy and use all space/and or other options. -
@nulluse
The layout define the size.Not reversed.
If you dont want the layout size for all widgets ,
u can then adjust with min/max sizes on individual widgets.
You can also instruct layout if u want to be greedy and use all space/and or other options.@mrjj said:
@nulluse
If you dont want the layout size for all widgets ,
u can then adjust with min/max sizes on individual widgets.
You can also instruct layout if u want to be greedy and use all space/and or other options.Exactly! This is double work, and very tedious one, versus defining the anchors.
The anchors do not require defining fixed sizes. -
@mrjj said:
@nulluse
If you dont want the layout size for all widgets ,
u can then adjust with min/max sizes on individual widgets.
You can also instruct layout if u want to be greedy and use all space/and or other options.Exactly! This is double work, and very tedious one, versus defining the anchors.
The anchors do not require defining fixed sizes.@nulluse
Yeah but layouts dont either.
Its assumed u want same size for all.
So only if u dont , u set it.
Its not double work as often NOT needed.
I want same size for all anyway.
and u can have margins if u want and many other nice tweaks. -
@mrjj said:
@nulluse
If you dont want the layout size for all widgets ,
u can then adjust with min/max sizes on individual widgets.
You can also instruct layout if u want to be greedy and use all space/and or other options.Exactly! This is double work, and very tedious one, versus defining the anchors.
The anchors do not require defining fixed sizes.@nulluse said:
Exactly! This is double work, and very tedious one, versus defining the anchors.
The anchors do not require defining fixed sizes.Neither do layouts. There are things called resize policies and stretch factors, which I suppose you should take a look at. Also how do you anchor two elements back to back such that one of them takes 2/3 of the space and one 1/3, ain't it necessary to go and set that manually?
-
@nulluse
Yeah but layouts dont either.
Its assumed u want same size for all.
So only if u dont , u set it.
Its not double work as often NOT needed.
I want same size for all anyway.
and u can have margins if u want and many other nice tweaks.@mrjj said:
@nulluse
Yeah but layouts dont either.
Its assumed u want same size for all.
So only if u dont , u set it.
Its not double work as often NOT needed.
I want same size for all anyway.
and u can have margins if u want and many other nice tweaks.You probably need to look at a system that uses anchors to realize how much more productive they allow the developers to be.
-
If the layouts are so wonderful, can anyone explain why specifying a horizontal layout for a form with 3 panels adds 9 pixel margin on all sides of the form? How can that margin be eliminated?
@nulluse said:
How can that margin be eliminated?
Simple: For centralWidget set layoutLeftMargin, layoutRightMargin, layoutTopMargin, layoutBottomMargin, and layoutSpacing all to 0. Default is 9, resp. 6.
-
BTW: If you want a fancy GUI that doesn't look / behave natively then you can use QtQuick for that. Besides layouts it has anchors, too.