728x90

PySide6 디자이너에서 버튼을 넣고 Python에서 클릭 이벤트를 연결해보자.

 

※ test.py 소스

from PySide6.QtWidgets import QApplication, QMainWindow, QMessageBox
from ui1 import Ui_MainWindow

class MainWindow(QMainWindow, Ui_MainWindow):
    def __init__(self, *args, obj=None, **args1):
        super(MainWindow, self).__init__(*args, **args1)
        self.setupUi(self)
        self.btn1.clicked.connect(self.btn1Clcik)
 
    def btn1Clcik(self):
         QMessageBox.about(self,'버튼','버튼클릭했습니다.')

app = QApplication()
window = MainWindow()
window.show()
app.exec()

 

 

728x90
반응형

+ Recent posts