as given in the snapshot, I want to add respective color icons for the items in the listwidget, like the blue icon for blue.png, etc. How can I do it?
and after I drag and drop elements from available textures to selected textures, there should be an icon in that widget as well.
if __name__ == "__main__":
ui_obj = TextureSwatcherUI()
files = []
for i in os.listdir("Q:/...../tex_source/"):
files.append(i)
list_item = QListWidgetItem(i, ui_obj.available_textures)
list_item.setIcon("Q:/...../tex_source/red.png")
This is the snippet where I was trying to get all the files and add them to my widget, now I need to add respective icons next to them as well.

I create one Minimal Example to show how you can add Icon to
QListWidgetItemYou should create one
QListWidgetItemand set one Icon to it and name(text) and etc and then you add it inQListWidget.you didn't have to add them by using
forloop.The Result: