PyQt – Padding of Checkbox Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report In this article we will see how to set padding to a check box. Padding is basically space between the border and the content. By default there is no padding space but with the help of style sheet we can set padding to a check box.Below is the representation of normal check box vs check box which has padding. Style sheet code to do this. QCheckBox { border : 2px solid black; padding : 10px; } Below is the implementation - Python3 # 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 checkbox = QCheckBox('Geek ?', self) # setting tristate check box checkbox.setTristate(True) # setting geometry of check box checkbox.setGeometry(200, 150, 100, 50) # adding border to the check box # and padding checkbox.setStyleSheet("QCheckBox" "{" "border : 2px solid black;" "padding : 10px;" "}") # 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 PyQt – Padding of Checkbox R rakshitarora Follow Improve Article Tags : Python Python-PyQt Python-gui Practice Tags : python Similar Reads PyQt5 â Stop checking in CheckBox In this article we will see how to stop the check box to get checked. Sometimes, while creating forms there is a need to stop the check box to get checked. In order to this we have to use setCheckable method and set it to False, this will stop the button to get checked. Syntax : checkbox.setCheckabl 1 min read PyQt5 - Image in Check Box In this article we will see how to set background image to check box. When we create a check box there is no image associated to it although we can set background color to it. Below is the representation of normal check box vs the check box which has image. In order to do this we have to set backgro 2 min read PyQt5 â Set Icon for Check Box In this article we will see about how to set icon to a check box. Setting icon to a check box is similar to setting icon to a main window, icon of check box appear in between the indicator and the check box it self below is how normal check box vs check box with icon looks like. In order to do this 2 min read PyQt5 - Padding in Progress Bar In this article we will see how to add padding to the progress bar. Padding is the space between border and the bar of progress bar. Below is the representation of normal progress bar vs padded progress bar. In order to do this we have to change the padding size in the CSS style sheet of progress ba 2 min read PyQt5 â Round indicator of CheckBox In this article we will see how to create round indicator of check box. By default, check box have square indicator although with the help of style sheet we can change it make it round. Below is the representation of normal indicator vs the round indicator of check box. In order to do this we have t 2 min read Like