有时候单靠使用QT的Layout无法保持,就需要调整QLayout的参数了
QLayout::SetDefaultConstraint | 0 | The main widget's minimum size is set to minimumSize(), unless the widget already has a minimum size. |
QLayout::SetFixedSize | 3 | The main widget's size is set tosizeHint(); it cannot be resized at all. |
QLayout::SetMinimumSize | 2 | The main widget's minimum size is set to minimumSize(); it cannot be smaller. |
QLayout::SetMaximumSize | 4 | The main widget's maximum size is set to maximumSize(); it cannot be larger. |
QLayout::SetMinAndMaxSize | 5 | The main widget's minimum size is set to minimumSize() and its maximum size is set to maximumSize(). |
QLayout::SetNoConstraint4 | 1 | The widget is not constrained. |
QLayout默认的主控件大小就是主控件的大小
要调整布局效果可以调用setSizeConstraint函数
如果不想当布局变化的时候改变控件大小就可以设置布局为SetFixedSize
其余类似