pyqt5 学习笔记六(QFormLayout)表单布局器
写在前面:
①本教程使用pycharm编译器进行pyqt5的学习,安装教程请大家自行百度
②本系列博客根据B站王铭东博主教程学习 学习代码 笔记6
链接:https://pan.baidu.com/s/1i3y4mI_9N84iAC6tav-j8Q
提取码:gupx
资料:
【1】B站教程
【2】B站教程配套课件
【3】PyQt官网的所有模块 (有部分内容没有补充进去)
【4】C++具体实现的API文档
PS:这一节B站视频缺失
(一)布局器
共有四种:
QBoxLayout:垂直水平布局器
QGridLayout:网格布局器
QFormLayout:表单布局器
QStackedLayout:抽屉布局器
(二)表单布局器
1、QLineEdit
edit1 = QLineEdit()
edit1.setPlaceholderText("请输入账号")
2、QFormLayout
layout = QFormLayout()
layout.addRow("账号:",edit1)
:添加行,标签+组件
import sys
from PyQt5.QtWidgets import QWidget,QApplication,QLineEdit,QPushButton,QFormLayout,QVBoxLayout
class MyWindow(QWidget):
def __init__