VOOZH about

URL: https://www.geeksforgeeks.org/python/pyqt5-qcombobox-change-border-style-when-it-is-in-off-state-and-mouse-hover-over-it/

⇱ PyQt5 QComboBox - Change border style when it is in off state and mouse hover over it - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

PyQt5 QComboBox - Change border style when it is in off state and mouse hover over it

Last Updated : 1 Feb, 2023

In this article we will see how we can change the border style of the combo box when it is in off state and mouse hover over it, border style can be dotted, dashed etc. When we set border to the combo box it is continuous although we can change it. Styled border will be only visible when combo box is in off state and cursor is on the combo box else normal border will be visible. In order to do this we have to change the style sheet associated with the combo box, below is the style sheet code

QComboBox::!off:hover
{
border : 4px black;
border-style : dotted;
}

Below is the implementation 

Output :

Comment