2020年3月18日

[PYTHON]PyQt5 前置程序

摘要: import sys # QApplication管理GUI程序的控制流和主要设置。 # QMainWindow主窗口管理 from PyQt5.QtWidgets import QApplication,QMainWindow import Ui_text11 if __name__ == "__ 阅读全文

posted @ 2020-03-18 09:02 dandanduba 阅读(333) 评论(0) 推荐(0) 编辑

2020年3月17日

[python]PyQt5- QLineEdit

摘要: 1.回显模式(EchoMode) (1)Normal(输入什么显示什么) (2)NoEcho(提交输入给计算机,但不回显) (3)Password (4)PasswordEchoOnEdit(先Echo,过一会然后用*代替) from PyQt5.QtWidgets import * import 阅读全文

posted @ 2020-03-17 10:16 dandanduba 阅读(554) 评论(0) 推荐(0) 编辑

[python]PyQt5- QLabel与伙伴控件

摘要: from PyQt5.QtWidgets import * import sys class lianxi_007(QDialog): def __init__(self): super().__init__() self.initUI() def initUI(self): self.setWin 阅读全文

posted @ 2020-03-17 09:52 dandanduba 阅读(722) 评论(0) 推荐(0) 编辑

2020年3月16日

[python]PyQt5-designer-练手小项目——计算器

摘要: 问题1: 'mywindow' object has no attribute 'setCentralWidget' 解决方法: 在designer中选择错误,我选择了QMainWindow,需要改为QWights 问题2: local variable 'num' referenced befor 阅读全文

posted @ 2020-03-16 15:23 dandanduba 阅读(662) 评论(0) 推荐(0) 编辑

2020年3月13日

[python]PyQt5- QLabel,练手程序

摘要: import sys from PyQt5.QtWidgets import QApplication, QLabel, QMainWindow,QVBoxLayout, QWidget from PyQt5.QtGui import QPalette,QPixmap from PyQt5.QtCo 阅读全文

posted @ 2020-03-13 14:31 dandanduba 阅读(516) 评论(0) 推荐(0) 编辑

2020年3月12日

[python]PyQt5- QLabel控件。

摘要: 一、Qlabel类中的常用方法setAlignment():按固定值方式对其文本: Qt.AlignLeft:水平方向靠左对其Qt.AlignRight:水平方向靠右对其Qt.AlignCenter:水平方向居中对其Qt.AlignJustify:水平方向两端对齐Qt.AlignTop:垂直方向靠上 阅读全文

posted @ 2020-03-12 14:56 dandanduba 阅读(2708) 评论(0) 推荐(0) 编辑

[python]PyQt5-设置按钮

摘要: import sys from PyQt5.QtWidgets import QToolTip,QPushButton,QApplication, QHBoxLayout, QMainWindow, QPushButton, QWidget from PyQt5.QtGui import QIcon 阅读全文

posted @ 2020-03-12 14:53 dandanduba 阅读(2627) 评论(0) 推荐(0) 编辑

[python、VScode]PyQt5-工具程序

摘要: 1、窗口主循环 if __name__ == "__main__": app = QApplication(sys.argv) # 导入图标 app.setWindowIcon(QIcon("./image/lou.ico")) main = ##类名##SMainWin() # 显示窗口 main 阅读全文

posted @ 2020-03-12 13:04 dandanduba 阅读(348) 评论(0) 推荐(0) 编辑

[python]PyQt5-设置按钮(按钮信号与槽)

摘要: 1、设置按钮; 2、子控件的各类方案的使用(setText) #添加Button self.button1 = QPushButton("退出应用程序") #将信号与槽关联 self.button1.clicked.connect(self.onClick_Button) #添加Button sel 阅读全文

posted @ 2020-03-12 13:02 dandanduba 阅读(6209) 评论(0) 推荐(0) 编辑

2020年3月11日

[python]PyQt5-手写窗口(状态栏,屏幕边框,图标等)

摘要: import sys from PyQt5.QtWidgets import QMainWindow,QApplication from PyQt5.QtGui import QIcon class FirstMainWin(QMainWindow): def __init__(self, pare 阅读全文

posted @ 2020-03-11 15:47 dandanduba 阅读(1150) 评论(0) 推荐(0) 编辑

导航