有時候單靠使用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
其余類似