PyQt5: Draw a line by clicking QPushButton
问题 I am trying to make it such that when I click a QPushButton a line is drawn. However the code I have right now makes the line at the beginning when the code is initiated and not after . The QPushButton doesn't seem to do any drawing. I also don't quite understand why when drawing you need an 'event' argument in the function. import sys from PyQt5 import QtCore, QtWidgets from PyQt5.QtWidgets import QMainWindow, QGridLayout,QPushButton, QApplication, QWidget from PyQt5.QtCore import QSize,