んこんにちは皆さん、もう一度お会いできてうれしいです!! 好久没发了,抱歉抱歉 O(∩_∩)O嘿嘿~
标签和文本输入框的使用: 文本输入框分为: 条形输入框:
引用QLineEdit 矩形输入框:
引用QTextEdit 标签模块:
引用QLabel 创建标签: title = QLabel(‘Title’) 创建条形文本输入框: titleEdit = QLineEdit() 创建矩形文本输入框: reviewEdit = QTextEdit() 创建表格布局并且设置组件之间的间距 grid = QGridLayout() grid.setSpacing(10) 添加部件并且设置其位置(坐标形式): grid.addWidget(reviewEdit,3,1,5,1) 3,1 为其行列 5,1为其中心点的坐标 将表格布局添加到窗口界面: self.setLayout(grid) 状态栏创建: class Example(QMainWindow): def __init__(self): super().__init__() self.initUI() 窗口继承了QMainWindow类 self则代表一个该对象 创建一个状态栏并且显示一个信息: self.statusBar().showMessage(‘Ready’) 使用statusBar()创建一个状态栏 使用showMessage(‘信息’) 来显示信息 注:不能重复使用否则不会进行覆盖 如下: self.statusBar().showMessage(‘Ready’) self.statusBar().showMessage(’ ') self.statusBar().showMessage(‘Hello World’)
代码记录四 End!
PyQt5学习笔记(四)

Hobby lead creation, technology change world.
- Post link: 377.html
- Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 3.0 unless stating additionally.