How to make a Qt Widget grow with the window size?

后端 未结 4 1972
灰色年华
灰色年华 2020-11-29 18:38

I want to have a small QFormLayout that grows to fill its parent widget.

I created a new .ui file using the QWidget template in Qt

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 19:15

    You need to change the default layout type of top level QWidget object from Break layout type to other layout types (Vertical Layout, Horizontal Layout, Grid Layout, Form Layout). For example:

    To something like this:

提交回复
热议问题