listview控件与updateText 相关联
self.listview.updateText.connect(self.viewlist)
updateText = QtCore.pyqtSignal(str)
#发送信号 updateText.emit(‘updated list‘)
def viewlist(self): print ‘view‘ if self.refresh==False: self.model = QStandardItemModel(self.ui.listView) for food in listviewdata: item = QStandardItem(food) item.setCheckable(True) self.model.appendRow(item)
时间: 2024-09-30 09:56:13