文章分类 -  PySide2学记笔记

PyQt5(19)打印设置对话框,打印pdf文件以及文件的读取
摘要:''' 使用打印机 ''' from PyQt5 import QtGui, QtWidgets, QtPrintSupport from PyQt5.QtWidgets import * import sys class PrintSupport(QMainWindow): def __init_ 阅读全文

posted @ 2020-02-25 13:14 把恐惧变成希望 阅读(1374) 评论(0) 推荐(0)

PyQt5(18)菜单栏、工具栏状态栏的使用
摘要:''' 创建和使用菜单 ''' import sys,math from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * class Menu(QMainWindow) : def __ini 阅读全文

posted @ 2020-02-24 15:50 把恐惧变成希望 阅读(259) 评论(0) 推荐(0)

PyQt5(15)QColorDialog颜色对话窗,注意调色板QPalette()的使用
摘要:''' 颜色对话框:QColorDialog ''' import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * class QColorDialogDemo(QWidge 阅读全文

posted @ 2020-02-24 15:48 把恐惧变成希望 阅读(453) 评论(0) 推荐(0)

PyQt5(17)剪贴板复制文本、图像、网址
摘要:''' 使用剪贴板 ''' import sys,math from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * class ClipBoard(QDialog): def __init_ 阅读全文

posted @ 2020-02-24 14:35 把恐惧变成希望 阅读(859) 评论(1) 推荐(1)

PyQt5(16)文本的绘制、像素点的绘制、绘制不同的直线、绘制 弧 圆形 椭圆 矩形(正方形) 多边形 用画刷填充图形区域
摘要:''' 绘图API:绘制文本 1. 文本 2. 各种图形(直线,点,椭圆,弧,扇形,多边形等) 3. 图像 QPainter painter = QPainter() painter.begin() painter.drawText(...) painter.end() 必须在paintEvent事 阅读全文

posted @ 2020-02-24 12:38 把恐惧变成希望 阅读(1058) 评论(0) 推荐(0)

PyQt5(16)对话框QDialog普通对话框、消息对话框(用于报错)字体对话框用于字体调节,文件对话框,文件的打开和读取
摘要:''' 对话框:QDialog普通对话框 QMessageBox QColorDialog QFileDialog打开或者保存 QFontDialog QInputDialog QMainWindow QWidget QDialog ''' import sys from PyQt5.QtCore 阅读全文

posted @ 2020-02-24 11:15 把恐惧变成希望 阅读(321) 评论(0) 推荐(0)

PyQt5(15)滑块控件(QSlider)
摘要:''' 滑块控件(QSlider) ''' import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * class QSliderDemo(QWidget): def __ 阅读全文

posted @ 2020-02-24 10:27 把恐惧变成希望 阅读(543) 评论(0) 推荐(0)

PyQt5(14)QComboBox的使用
摘要:''' 下拉列表控件(QComboBox) 1. 如果将列表项添加到QComboBox控件中 2. 如何获取选中的列表项 ''' import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets 阅读全文

posted @ 2020-02-24 10:11 把恐惧变成希望 阅读(1765) 评论(0) 推荐(0)

PyQt5(13)多种按钮控件QAbstractButton的子类
摘要:''' 单选按钮控件(QRadioButton) ''' import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * class QRadioButtonDemo(QWid 阅读全文

posted @ 2020-02-24 09:55 把恐惧变成希望 阅读(209) 评论(0) 推荐(0)

PyQt5(12)多行输入
摘要:''' QTextEdit控件 ''' from PyQt5.QtWidgets import * import sys class QTextEditDemo(QWidget) : def __init__(self): super(QTextEditDemo,self).__init__() s 阅读全文

posted @ 2020-02-24 09:54 把恐惧变成希望 阅读(455) 评论(0) 推荐(0)

PyQt5(12)QLineEdit的总结
摘要:''' QLineEdit综合案例 ''' from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import Qt import sys class QLineEditDemo(QWidget): def 阅读全文

posted @ 2020-02-23 13:11 把恐惧变成希望 阅读(1142) 评论(0) 推荐(0)

PyQt5(12)QLineEdit掩码,即规定输入的格式就像DNS
摘要:''' 用掩码限制QLineEdit控件的输入 A ASCII字母字符是必须输入的(A-Z、a-z) a ASCII字母字符是允许输入的,但不是必需的(A-Z、a-z) N ASCII字母字符是必须输入的(A-Z、a-z、0-9) n ASII字母字符是允许输入的,但不是必需的(A-Z、a-z、0- 阅读全文

posted @ 2020-02-23 12:56 把恐惧变成希望 阅读(1130) 评论(0) 推荐(0)

PyQt5(11)QLineEdit的整数、浮点数或满足一定条件的字符串的校验
摘要:''' 现在QLineEdit控件的输入(校验器) 如限制只能输入整数、浮点数或满足一定条件的字符串 ''' from PyQt5.QtWidgets import * from PyQt5.QtGui import QIntValidator,QDoubleValidator, QRegExpVa 阅读全文

posted @ 2020-02-23 12:50 把恐惧变成希望 阅读(2179) 评论(0) 推荐(1)

PyQt5(10)QLineEdit控件与回显模式以及QFormLayout()表单布局的应用
摘要:''' QLineEdit控件与回显模式 基本功能:输入单行的文本 EchoMode(回显模式) 4种回显模式 1. Normal正常输入什么显示什么 2. NoEcho敲半天什么都没有 3. Password变成点 4. PasswordEchoOnEdit显示一会变成* Mac : Comman 阅读全文

posted @ 2020-02-23 12:40 把恐惧变成希望 阅读(361) 评论(0) 推荐(0)

PyQt5(9)伙伴关系设置以及QDialog控件的引用
摘要:''' QLabel与伙伴控件 mainLayout.addWidget(控件对象,rowIndex,columnIndex,row,column) ''' from PyQt5.QtWidgets import * import sys class QLabelBuddy(QDialog): #继 阅读全文

posted @ 2020-02-23 10:55 把恐惧变成希望 阅读(457) 评论(0) 推荐(0)

PyQt5(8)QLabel控件的背景颜色填充以及QWidget和QMainWindow的区别,以及网页的调用以及鼠标的操作调用
摘要:import sys from PyQt5.QtWidgets import QVBoxLayout,QMainWindow,QApplication,QLabel,QWidget from PyQt5.QtGui import QPixmap, QPalette from PyQt5.QtCore 阅读全文

posted @ 2020-02-23 10:43 把恐惧变成希望 阅读(1973) 评论(0) 推荐(0)

PyQt5(7)QLabel控件
摘要:QLabel控件setAlignment():设置文本的对齐方式setIndent():设置文本缩进text():获取文本内容setBuddy():设置伙伴关系setText():设置文本内容selectedText():返回所选择的字符setWordWrap():设置是否允许换行 QLabel常用 阅读全文

posted @ 2020-02-23 10:41 把恐惧变成希望 阅读(403) 评论(0) 推荐(0)

PyQt5(6)提示信息设置
摘要:import sys from PyQt5.QtWidgets import QMainWindow,QApplication,QWidget,QHBoxLayout,QPushButton from PyQt5.QtWidgets import QToolTip from PyQt5.QtGui 阅读全文

posted @ 2020-02-22 21:22 把恐惧变成希望 阅读(261) 评论(0) 推荐(0)

PyQt5(5)设置窗口提示信息放上去就显示的
摘要:import sys from PyQt5.QtWidgets import QMainWindow,QApplication,QWidget,QHBoxLayout,QPushButton from PyQt5.QtWidgets import QToolTip from PyQt5.QtGui 阅读全文

posted @ 2020-02-22 21:14 把恐惧变成希望 阅读(471) 评论(0) 推荐(0)

PyQt5(4)同时设置图标和窗口位置和大小代码
摘要:import sys from PyQt5.QtWidgets import QMainWindow,QApplication,QDesktopWidget from PyQt5.QtGui import QIcon #图标 class FirstMainWin(QMainWindow): def 阅读全文

posted @ 2020-02-22 20:40 把恐惧变成希望 阅读(1742) 评论(0) 推荐(1)

导航