In this article we will see how we can hide the items of the combo box from the drop down box i.e from view box. In order to do so we have to get the view object of combo box and had to hide it.
In order to hide the items we have to do the following steps –
1. Create Combo box
2. Add items to the combo box
3. Get the view object of combo box
4. Hide the view object
# getting view part of combo box view = self.combo_box.view() # hiding the view part view.setHidden(True)
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.
- PyQt5 ComboBox – User entered items not stored in drop down menu
- PyQt5 - Checking if drop down items are hidden or not in ComboBox
- PyQt5 Combo Box - Background image to down arrow
- PyQt5 Combo Box - Background image to down arrow when pressed
- PyQt5 - Adding border to drop arrow of Combo Box
- PyQt5 - Combo Box with check-able items
- PyQt5 - Setting tool tip to the view (drop-down) part of ComboBox
- PyQt5 - Setting tool tip duration to the view(drop-down) part of the ComboBox
- PyQt5 - Access tooltip duration to view(drop-down) of ComboBox
- PyQt5 - Access tooltip of view(drop-down) of ComboBox
- Python | Drop-down list in kivy using .kv file
- How to select a drop-down menu value using Selenium in Python?
- Select Drop-down list using select_by_index() in Selenium - Python
- Selecting a drop-down list by using the Selenium.select_by_visible_text() method in Python
- PyQt5 - Checking if the Combo box is having frame or not
- PyQt5 - Getting minimum content length to Combo Box item | minimumContentsLength() method
- PyQt5 - Setting visible column in the model of combo box
- PyQt5 - How to get visible column in the model of combo box
- PyQt5 - How to set view to the combo box
- PyQt5 - Setting help text of the combo box
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.