摘要: 1 #demo_12:网格布局 2 import sys 3 from PyQt5.QtWidgets import QApplication,QWidget,QGridLayout,QPushButton,QLineEdit,QTextEdit,QLabel 4 5 class Example(QWidget): 6 def __init__(self): 7 ... 阅读全文
posted @ 2018-09-30 17:09 zyg_100 阅读(4455) 评论(0) 推荐(1) 编辑
摘要: 1 #demo_11:网格布局 2 import sys 3 from PyQt5.QtWidgets import QApplication,QWidget,QGridLayout,QPushButton 4 5 class Example(QWidget): 6 def __init__(self): 7 super().__init__() 8 ... 阅读全文
posted @ 2018-09-30 17:06 zyg_100 阅读(1685) 评论(0) 推荐(0) 编辑
摘要: 1 #!/usr/bin/python3 2 # -*- coding: utf-8 -*- 3 4 ''' 即横向和纵向布局:QHBoxLayout, QVBoxLayout ''' 5 6 import sys 7 from PyQt5.QtWidgets import (QWidget, QPushButton, 8 ... 阅读全文
posted @ 2018-09-30 17:02 zyg_100 阅读(3456) 评论(0) 推荐(0) 编辑
摘要: 1 import sys 2 from PyQt5.QtWidgets import QWidget,QLabel,QApplication 3 #demo_8: 绝对定位 4 5 class Example(QWidget): 6 def __init__(self): 7 super().__init__() 8 self.in... 阅读全文
posted @ 2018-09-30 16:58 zyg_100 阅读(1799) 评论(0) 推荐(0) 编辑
摘要: 1 from PyQt5.QtWidgets import QApplication,QMainWindow,QAction 2 from PyQt5.QtGui import QIcon 3 #demo_7:菜单添加action以及状态栏显示消息 4 import sys 5 class Example(QMainWindow): 6 def __init__(self):... 阅读全文
posted @ 2018-09-30 16:55 zyg_100 阅读(6320) 评论(0) 推荐(0) 编辑
摘要: 1 from PyQt5.QtWidgets import QApplication,QMainWindow 2 import sys 3 #demo_6显示状态栏 4 class Example(QMainWindow): 5 def __init__(self): 6 super().__init__() 7 self.initUI() ... 阅读全文
posted @ 2018-09-30 16:50 zyg_100 阅读(2065) 评论(0) 推荐(0) 编辑
摘要: 1 import sys 2 from PyQt5.QtWidgets import QApplication, QWidget,QToolTip,QPushButton,QMessageBox,QDesktopWidget 3 from PyQt5.QtGui import QIcon,QFont 4 from PyQt5.QtCore import QCoreApplication ... 阅读全文
posted @ 2018-09-30 16:48 zyg_100 阅读(3585) 评论(0) 推荐(0) 编辑
摘要: import sys from PyQt5.QtWidgets import QApplication, QWidget,QToolTip,QPushButton from PyQt5.QtGui import QIcon,QFont from PyQt5.QtCore import QCoreApplication #demo_4:通过一个按钮关闭窗体 class Exception(QWid... 阅读全文
posted @ 2018-09-30 16:44 zyg_100 阅读(3500) 评论(0) 推荐(0) 编辑
摘要: import sys from PyQt5.QtWidgets import QApplication, QWidget,QToolTip,QPushButton from PyQt5.QtGui import QIcon,QFont #demo_3:显示一个提示信息文本 class Exception(QWidget): def __init__(self): supe... 阅读全文
posted @ 2018-09-30 16:43 zyg_100 阅读(3718) 评论(0) 推荐(0) 编辑
摘要: import sys from PyQt5.QtWidgets import QApplication, QWidget from PyQt5.QtGui import QIcon #demo_2:显示一个窗体,设置一个图标 class Example(QWidget): def __init__(self): super().__init__() sel... 阅读全文
posted @ 2018-09-30 16:38 zyg_100 阅读(7574) 评论(1) 推荐(0) 编辑