1 Star 0 Fork 342

Kevin/PyQt

forked from PyQt5/PyQt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

QVBoxLayout

1、垂直布局

查看 BaseVerticalLayout.ui

BaseVerticalLayout

2、边距和间隔

查看 VerticalLayoutMargin.ui

  1. 通过setContentsMargins(20, 20, -1, -1)设置左上右下的边距,-1表示默认值
  2. 通过setSpacing设置控件之间的间隔

VerticalLayoutMargin

3、比例分配

查看 VerticalLayoutStretch.ui

通过setStretch设置各个部分的占比 分别为:1/6 2/6 3/6

self.verticalLayout.setStretch(0, 1)
self.verticalLayout.setStretch(1, 2)
self.verticalLayout.setStretch(2, 3)

VerticalLayoutStretch

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/Kevin-Jun/PyQt.git
git@gitee.com:Kevin-Jun/PyQt.git
Kevin-Jun
PyQt
PyQt
master

搜索帮助