1、介绍
QWidget,是pyqt5几乎所有组件的父类。同时也是窗口组件之一。
2、基础使用
show(self)
- 显示组件
- 如果是作为窗口,那么必须调用show方法,窗口才会显示
hide(self)
- 隐藏组件
close(self) -> bool
- 关闭窗口
3、标题栏
setWindowTitle(self, a0: str)
- 设置窗口标题
windowTitle(self) -> str
- 获取窗口标题
setWindowIcon(self, icon: QIcon)
- 设置窗口图标
windowIcon(self) -> QIcon
- 获取窗口图标
4、其它设置
setToolTip(self, a0: str)
- 设置工具提示,即鼠标移动到组件上停留时会显示设置文本
toolTip(self) -> str
- 获取工具提示文本