上一页 1 2 3 4 5 6 7 8 ··· 15 下一页
摘要: 通过对按钮绑定函数来生成信号和槽,即信号是按钮点击时发送的信号, 槽为对应绑定的函数 SignalSlotDemo.py """ 信号(Signal) 与槽(Slot) """ from PyQt5.QtWidgets import * import sys class SigalSlotDemo( 阅读全文
posted @ 2022-02-06 20:41 c语言我的最爱 阅读(3003) 评论(0) 推荐(0) 编辑
摘要: 将水平或者垂直的布局修改为可以拖动长宽的布局 Splitter.py """ 拖动控件之间的边界(Splitter) """ import sys, math from PyQt5.QtWidgets import * from PyQt5.QtCore import Qt class Splitt 阅读全文
posted @ 2022-02-06 20:25 c语言我的最爱 阅读(1161) 评论(0) 推荐(0) 编辑
摘要: 添加标签和每一行的文本来构造表单布局 FormLayout.py """ 表单布局 """ import sys, math from PyQt5.QtWidgets import * class FormForm(QWidget): def __init__(self): super(FormFo 阅读全文
posted @ 2022-02-06 20:07 c语言我的最爱 阅读(969) 评论(0) 推荐(0) 编辑
摘要: 对栅格布局添加控件,通过控件的位置和长宽来控制大小和位置 GridForm.py """ 栅格布局: 表单设计 """ import sys, math from PyQt5.QtWidgets import * class GridForm(QWidget): def __init__(self) 阅读全文
posted @ 2022-02-06 17:06 c语言我的最爱 阅读(2043) 评论(0) 推荐(0) 编辑
摘要: 在栅格布局上构造计算器的按钮, Calc.py """ 栅格布局: 实现计算器UI """ import sys, math from PyQt5.QtWidgets import * class Calc(QWidget): def __init__(self): super(Calc, self 阅读全文
posted @ 2022-02-06 15:08 c语言我的最爱 阅读(767) 评论(0) 推荐(0) 编辑
摘要: 通过构建垂直布局,然后将上半部和需要放在下方的按钮,设置收缩量,一个收缩量为0, 按钮的收缩量为1 RightBottomButton.py """ 让按钮永远在窗口右下角 """ import sys, math from PyQt5.QtWidgets import * from PyQt5.Q 阅读全文
posted @ 2022-02-06 14:48 c语言我的最爱 阅读(471) 评论(0) 推荐(0) 编辑
摘要: 添加成比例的收缩量,如果收缩量为0时,所有的控件都分布在界面的左边 当收缩量不为0时 Stretch.py """ 设置控件的伸缩量 """ import sys, math from PyQt5.QtWidgets import * from PyQt5.QtCore import Qt clas 阅读全文
posted @ 2022-02-06 14:34 c语言我的最爱 阅读(916) 评论(0) 推荐(0) 编辑
摘要: 垂直布局和水平布局的参数调用情况是一致的 VBoxLayout.py """ 垂直盒布局(QVBoxLayout) """ import sys, math from PyQt5.QtWidgets import * class VBoxLayout(QWidget): def __init__(s 阅读全文
posted @ 2022-02-06 13:49 c语言我的最爱 阅读(829) 评论(0) 推荐(0) 编辑
摘要: 在添加组件的同时, 设置间距和对齐的方式 HBoxLayoutAlign.py """ 设置控件的对齐方式 """ import sys, math from PyQt5.QtWidgets import * from PyQt5.QtCore import Qt class HBoxLayout( 阅读全文
posted @ 2022-02-06 13:38 c语言我的最爱 阅读(2782) 评论(0) 推荐(0) 编辑
摘要: 构造水平布局, 在水平布局上添加按钮,同时调节了按钮之间的间距 HBoxLayout.py """ 水平盒布局(QHBoxLayout) """ import sys, math from PyQt5.QtWidgets import * class HBoxLayout(QWidget): def 阅读全文
posted @ 2022-02-06 13:22 c语言我的最爱 阅读(328) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 15 下一页