반응형
이렇게 라디오 버튼 3개를 뙁뙁뙁
pyuic5 -x UI/radio_btn_ui.ui -o UI/radio_btn_ui.py
import sys
from PyQt5.QtWidgets import *
import UI.radio_btn_ui
class MyWindow(QMainWindow, UI.radio_btn_ui.Ui_MainWindow):
def __init__(self):
super().__init__()
self.setupUi(self)
self.radioButton.clicked.connect(self.RadioFuntion)
self.radioButton_2.clicked.connect(self.RadioFuntion)
self.radioButton_3.clicked.connect(self.RadioFuntion)
def RadioFuntion(self):
if self.radioButton.isChecked():
print("Radio BTN Check")
elif self.radioButton_2.isChecked():
print("Radio1 BTN Check")
elif self.radioButton_3.isChecked():
print("Radio2 BTN Check")
if __name__ == "__main__":
app = QApplication(sys.argv)
myApp = MyWindow()
myApp.show()
app.exec_()
결과
반응형
'공부 > Python' 카테고리의 다른 글
5.[Text]Qt Designer + PyQt5 (0) | 2021.05.07 |
---|---|
4.[check box]Qt Designer + PyQt5 (0) | 2021.05.07 |
2.[Dialog]Qt Designer + PyQt5 (0) | 2021.05.06 |
1.[Button]Qt Designer + PyQt5 (0) | 2021.05.06 |
[Python]여러 엑셀 파일 불러와서 저장하기 (0) | 2020.06.16 |