일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- 파싱
- Python
- 자동글쓰기
- cocos2d-x
- 가상서버
- 아두이노 초보
- 자동블로그
- 워드프레스
- 그누보드
- 아두이노 기초강좌
- 웹
- flex
- Ajax
- 챗지피티
- vps
- ChatGPT
- 무료일러스트
- c#
- 아두이노
- 프로그램
- HTML
- vultr
- 아두이노 강좌
- php
- Javascript
- 파이썬
- 자바스크립트
- 쿠팡파트너스
- Php공부
- 자동포스팅
- Today
- Total
플밍
콤보박스 예제 본문
여러가지 방법이 있지만 그 중에 하나
#ads_1
class Example(QWidget):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.lbl = QLabel(self)
self.lbl.move(50, 50)
combo = QComboBox(self)
combo.addItem("독수리", "eagle")
combo.addItem("강아지", "puppy")
combo.addItem("고양이", "cat")
combo.move(50, 100)
combo.activated[str].connect(self.changeCombo)
self.setGeometry(300, 300, 300, 200)
self.setWindowTitle('QSplitter')
self.show()
def changeCombo(self, text):
sender = self.sender()
idx = sender.currentIndex()
self.lbl.setText(sender.itemData(idx))
self.lbl.adjustSize()
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
#ads_2