PyQt51 pyqt5에서 포인트 이동하며 방향 바꾸기 pyqt5는 QTimer를 구현하기만 하면 타이머가 트리거될 때마다 self.update()를 사용하며 드로잉을 업데이트하고 원하는 위치로 업데이트할 수 있다. #!/usr/bin/env python3 import sys from PyQt5.QtCore import pyqtSlot, QTimer, Qt, QCoreApplication from PyQt5.QtGui import QPainter, QPen from PyQt5.QtWidgets import QWidget, QApplication, QPushButton class MainWindow(QWidget): def __init__(self): super().__init__() self.initUI() self.pos_x = int(self.width(.. 2020. 8. 15. 이전 1 다음