PyQt5 – Setting background image to check box when hover Last Updated : 22 Apr, 2020 Comments Improve Suggest changes Like Article Like Report In this article we will see how we can set background image to the check box when mouse hover over it, by default there is no background image associated with it. This background image will only appear when mouse hover over it. In order to add background image to the check box we have to change the style sheet code, below is the style sheet code to do this. QCheckBox::hover { background-image : url(image.png); } Below is the implementation. Python3 1== # importing libraries from PyQt5.QtWidgets import * from PyQt5 import QtCore, QtGui from PyQt5.QtGui import * from PyQt5.QtCore import * import sys class Window(QMainWindow): def __init__(self): super().__init__() # setting title self.setWindowTitle("Python ") # setting geometry self.setGeometry(100, 100, 600, 400) # calling method self.UiComponents() # showing all the widgets self.show() # method for widgets def UiComponents(self): # creating the check-box checkbox1 = QCheckBox('Geek ?', self) # setting geometry of check box checkbox1.setGeometry(200, 150, 100, 40) # changing style sheet code of check box # adding background image to it when mouse hover over it checkbox1.setStyleSheet("QCheckBox::hover" "{" "background-image : url(image.png)" "}") # create pyqt5 app App = QApplication(sys.argv) # create the instance of our Window window = Window() # start the app sys.exit(App.exec()) Output : Comment More infoAdvertise with us Next Article PyQt5 – Setting background image to check box when hover R rakshitarora Follow Improve Article Tags : Python Python-PyQt Python-gui Practice Tags : python Similar Reads PyQt5 â Setting background image to indicator when hover checked Check Box In this article we will see how to set background image to indicator of check box when it is in checked state and mouse hover it. In order to do so we have to change the style sheet of the indicator in the check box for checked state and when mouse is moving over it. Below is the style sheet code. Q 2 min read PyQt5 - Setting background image to ComboBox when mouse hover In this article we will see how we can set background image to the combo box when mouse hover over it. By default combo box has no image although we can set image to it. Background image will appear only when cursor mover over the combo box In order to do this we have to change the style sheet assoc 2 min read PyQt5 â Setting unchecked Check Box indicator background image when hover In this article we will see how to set background image to indicator of check box when it is in unchecked state and mouse hover. In order to do so we have to change the style sheet of the indicator in the check box for unchecked state and when mouse is moving over it. Below is the style sheet code. 2 min read PyQt5 - Setting background color to ComboBox when mouse hover In this article we will see how we can set the background color to the combo box when mouse hover over it. By default combo box is of grey color although we can change its color. This background color only appear when mouse hover over the combo box widget. In order to do this we have to change the s 2 min read PyQt5 â Unchecked Check Box background when hovering In this article, we will see how to set background color to the check box for label part when mouse hover and it is in the currently checked state. In order to do this we have to change the style sheet of the check box and have to add the background color for the checked state when mouse hover over 2 min read Like