PyQt5 – How to set icon to the each item in ComboBox
In this article we will see how we can add icon to the item of combo box. By default there is no icon set to the icon in the combo box although we can set icon to each item with the help of
setItemIcon method, below is the representation of how icon of item in combo box looks like.
Syntax : combobox.setItemIcon(index, icon)
Argument : It takes two argument one is integer i.e index of item and other is the QIcon object
Action It will set icon to the item at the given index
Below is the implementation –
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course