pyqt4文档阅读(6.1):QBoxLayout-QHBoxLayout-QVBoxLayout

本文详细介绍了QBoxLayout,包括其属性、QHBoxLayout和QVBoxLayout的使用。QBoxLayout是一维布局,用于线性排列控件。QHBoxLayout和QVBoxLayout分别表示水平和垂直布局。文中讲解了布局方向、添加控件、空白区域、控件间距等关键概念,并提供了相关方法的介绍。
摘要由CSDN通过智能技术生成

本系列文章长期更新修改.


QBoxLayout是常用的线性布局,如果说QGridLayout是二维上的布局,QBoxLayout就是一维上的布局.

QHBoxLayout和QVBoxLayout继承自QBoxLayout,分别是水平和垂直的盒子布局.


属性:


QBoxLayout

Types

  • enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop, Down, Up }

Methods

  • __init__ (self, Direction direction, QWidget parent = None)
  • addItem (self, QLayoutItem)
  • addLayout (self, QLayout layout, int stretch = 0)
  • addSpacerItem (self, QSpacerItem spacerItem)
  • addSpacing (self, int size)
  • addStretch (self, int stretch = 0)
  • addStrut (self, int)
  • addWidget (self, QWidget, int stretch = 0, Qt.Alignment alignment = 0)
  • int count (self)
  • Direction direction (self)
  • Qt.Orientations expandingDirections (self)
  • bool hasHeightForWidth (self)
  • int heightForWidth (se
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值