如何在 pyqt4 python 中自动调整大小?

how to auto resize in pyqt4 python?

我想在用户调整主图大小时自动将上面的图片调整为如下所示的大小window。

pyqt4中是否有任何功能可以做到这一点?

我正在寻找这个问题的答案...但我找不到相关的东西。

我尝试设置固定的最小尺寸,但这不起作用。

如何在 pyqt4 (python) 中自动调整 window 的大小?

图片在qtdesigner中获取。

如果您使用的是QtDesigner,那真的很简单。看看像 vertical layout, horizontal layout 这样的布局 按照步骤:

1. Add layout to your main window.
2. Right click main window and click 'layout vertically' as you want button below 
   the text area
3. Then add(drag-n-drop) your text area inside vertical area.
4. Add button and what not....
5. Have a look at  'http://doc.qt.io/qt-4.8/designer-layouts.html' google for    
   properties of layout like alignment of element. size, orientation.