def init_widget(self):
"""
?? ??? ???? ???
"""
self.setWindowTitle("QComboBox Widget")
form_lbx = QBoxLayout(QBoxLayout.TopToBottom, parent=self)
self.setLayout(form_lbx)
lb = QLabel()
qb = QComboBox()
qb.addItem("Banana") # ?? ??? ???
qb.addItems(["Apple", "Tomato", "Carrot"]) # ?? ??? ???
qb.insertSeparator(2) # ?? ?
qb.currentTextChanged.connect(lb.setText) # ?? ???? ???? ?? ?
form_lbx.addWidget(qb)
form_lbx.addWidget(lb)
评论列表
文章目录