PyQt5最全28 绘图之绘制各种图形及图像
import sys
from PyQt5.QtWidgets import QApplication, QWidget
from PyQt5.QtGui import QPainter, QColor, QFont, QPen, QPolygon, QImage
from PyQt5.QtCore import Qt, QRect, QPoint
class DrawAll(QWidget):
"""
绘制各种图形
弧 圆形 椭圆 矩形 正方形 多边形 图像
QPainter
painter = QPainter()
painter.begin()
painter.drawText(...)
painter.end()
必须在事件方法中绘制各种元素
"""
def __init__(self):
super(DrawAll, self).__init__()
self.setWindowTitle('绘制各种图形')
self.resize(300, 600)
def