PyQt5 – Setting tool tip duration to the view(drop-down) part of the ComboBox
In this article we will see how we can set the tool tip duration to the drop down part of the combo box. When we set tool tip to the combo box it only shows for the line edit part, tool tip is not visible for the drop down part i.e its view part.
In order set tool tip duration to the view part, do the following –
1. Create Combo box
2. Add items to the combo box
3. Get the view object of the combo box
4. Add tool tip to the view object
5. set tool tip duration to the view object
# getting view part of combo box view = self.combo_box.view() # setting tool tip to view object of the combo box view.setToolTip(tip) # setting tool tip duration to view object view.setToolTipDuration(2000)
Below is the implementation
This tool tip get vanished after 2 seconds
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