def init_widget(self):
self.setWindowTitle("QComboBox Widget")
self.setMinimumWidth(350)
form_lbx = QBoxLayout(QBoxLayout.TopToBottom, parent=self)
self.setLayout(form_lbx)
data = [
{"name": "Apple", "image": IMAGE_PATH + "apple.jpg", "color": "Red"},
{"name": "Banana", "image": IMAGE_PATH + "banana.jpg", "color": "Yellow"}
]
model = UserModel(data)
qb = QComboBox()
view = QTableView()
view.setSelectionBehavior(view.SelectRows) # ? ? ??? ??
qb.setView(view)
qb.setModel(model)
form_lbx.addWidget(qb)
QComboBox_03_model_tableview.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录