PyQt5 – Add multiple separator in between item of ComboBox
In this article we will see how we can add multiple of separator in between the items of the combo box, by default there is no separator. Separator is the black line in between two items, in order to add he separator we use insertSeparator method. Below is representation of how combo box items with a separator looks like
In order to add multiple separator we will use insertSeparator method multiple times but initial giving the index value of max index then second maximum index value and so on, if we first give the minimum index value then other statements will only increase the size of the minimum index vale separator.
For adding separator at two places only
Here, indexes is the list of two index
Argument : It takes integer as argument i.e index
Action performed : It will add separator 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