Question

I'm using pyqt and wanted to display different images with each item of a combobox. It doesn't have to be a qcombobox, any form of a drop down menu will do.

Appretiate any answers/ links to examples.

Thank you

Was it helpful?

Solution

Yes, you can do this using QComboBox:

combo = QComboBox()
combo.addItem(QIcon("path/to/image.png"), "Item 1")
combo.addItem(QIcon("path/to/image2.png"), "Item 2")
...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top