Смотреть видео: python - PyQt5: Draw a line by clicking QPushButton - Stack Overflow