What is the difference between QSizePolicy::Expanding and QSizePolicy::Ignored?
-
I understand what the documentation says about the various policies, but what are the cases when the Expanding policy does not behave like the Ignored policy? I didn't find any relevant info on the net and on this forum.
Expanding
means the given widget is allowed to expand and shrink, if able to. But the preferred size issizeHint
OR larger (e.g. to increase readability of the widget).
Ignored
means the widget'ssizeHint
will be ignored completely and it take as much space as it is available. -
Expanding
means the given widget is allowed to expand and shrink, if able to. But the preferred size issizeHint
OR larger (e.g. to increase readability of the widget).
Ignored
means the widget'ssizeHint
will be ignored completely and it take as much space as it is available.@Pl45m4 Ok, basically both give a given widget "as much space as possible". I am curious what are the cases when Expanding do not give "as much space as possible" to the widget? What conditions are needed to not expand the widget with the Expanding policy?
-
@Pl45m4 Ok, basically both give a given widget "as much space as possible". I am curious what are the cases when Expanding do not give "as much space as possible" to the widget? What conditions are needed to not expand the widget with the Expanding policy?
-
@Pl45m4 Limited expansion is still an expansion, and in a sense every expansion is limited. Or do you say that there are different types of expansion? If that is the case, why does the documentation say nothing about it? So, is Expanding expansion different than Ignored expansion? If yes, then what is the difference?
I checked the QSizePolicy documentation and still don't know what the difference between Expanding and Ignored is.
-
QSizePolicy::Expanding has 3 flags: GrowFlag | ShrinkFlag | ExpandFlag
QSizePolicy::Ignored has 3 flags: ShrinkFlag | GrowFlag | IgnoreFlag
Both have GrowFlag and ShrinkFlag, but one has ExpandFlag, and the other one has IgnoreFlag.
I know that only with the ExpandFlag I can use the QSizePolicy::expandingDirections() function, but I want to know the behavioral difference. From the descriptions of these two flags, it seems that maybe there are cases of using the ExpandFlag when the widget does not get as much space as possible. What are these cases?