You are already controlling it in the sample (the wrong way):
in f2_sizeChanged you set the height of the parent to the size of the child being resized. The child f2 is set both to fill and to autosize. It cannot autosize on the content and fill to the parent at the same time. And the size loop makes a mess.
Other panels are also set to both autosize and fill at the same time.
No need to call Update or Invalidate anywhere.
It’s unclear what you are trying to achieve. If you describe what kind of layout you are trying to build we may be able to help.