I was able to add custom QListWidgetItem in QListWidget using the following code -
for item in dl_list:
widget = QtWidgets.QWidget()
card = Ui_DownloadCard()
card.setupUi(widget)
card.set_filename(item["title"])
card.set_progress_bar(item["progress"])
card.set_progress_text(item["progress"]/item["size"])
card.set_speed(item["speed"])
listItem = QtWidgets.QListWidgetItem(self.download_list)
listItem.setSizeHint(widget.sizeHint())
self.myListWidget.addItem(listItem)
self.myListWidget.setItemWidget(listItem, widget)
Now I wish to update each item with new speed & progress. I tried the following code -
self.myListWidget.item(0).set_speed("300 KB/s")
But it gives error saying
AttributeError: 'QListWidgetItem' object has no attribute 'set_speed'
So what is the correct way to update the item?