qypt51 PyQt5 - 윈도우화면에 QPushButton 추가하기 이번에는 "def setupUI(self):"라는 함수를 만들어서 윈도우와 버튼을 추가하여 보겠습니다. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 import sys from PyQt5.QtWidgets import * class MyWindow(QMainWindow): def __init__(self): super().__init__() self.setupUI() def setupUI(self): self.setWindowTitle("푸쉬버튼윈도우") btn = QPushButton('클릭해 주세요',self) btn.move(20,20) btn.clicked.connect(self.btn_clicked) def btn_clicked(se.. 2020. 12. 4. 이전 1 다음