
QCheckBox 사용법
·
사소한 아이의 소소한 스킬/PyQT5
import sys from PyQt5.QtWidgets import QApplication, QWidget, QCheckBox, QVBoxLayout from PyQt5.QtCore import Qt class MyApp(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self): cb = QCheckBox('Show title', self) # Text 설정 cb.setText("SetText") # Text 가져오기 print(cb.text()) # 상태 변경 cb.toggle() # 상태 확인하기 print(cb.isChecked()) # 상태 변경 이벤트 cb.stateChanged.connect(self.cha..