PyQt5 – How to add separator in between the item of ComboBox
In this article we will see how we can add separator at the desired index in 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 combo box items with a separator looks like –
Syntax : combo_box.insertSeparator(index)
Argument : It takes integer as argument i.e index
Action performed : It will add separator at the given index
Note: If the index is equal to or higher than the total number of items, the new item is appended to the list of existing items. If the index is zero or negative, the new item is prepended to the list of existing items.
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