PyQt5 | How to create colorful border of Push Button ? Last Updated : 22 Apr, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article we will see how to create colorful border of Push button. By default, push button have a button but we can also change the border color and size as well. PyQt5 allows us to change the color of push button with the help of style sheet. Syntax : button.setStyleSheet("border :5px solid ;" "border-top-color : red; " "border-left-color :pink;" "border-right-color :yellow;" "border-bottom-color : green") Argument : It takes string as argument. Action performed : It will set different color to different sides. Code : Python3 1== # importing libraries from PyQt5.QtWidgets import * 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 a push button button = QPushButton("CLICK", self) # setting geometry of button button.setGeometry(200, 150, 100, 40) # adding action to a button button.clicked.connect(self.clickme) # creating colorful border button.setStyleSheet("border :5px solid ;" "border-top-color : red; " "border-left-color :pink;" "border-right-color :yellow;" "border-bottom-color : green") # action method def clickme(self): # printing pressed print("pressed") # 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 | How to create capsule shaped push button ? R rakshitarora Follow Improve Article Tags : Python Python-PyQt Python-gui Practice Tags : python Similar Reads PyQt5 â Dotted border of Push Button In this article we will see how to create dotted border to an Push Button. Below is how normal button vs dotted border looks like. In order to do this we have to change the border style from solid to dotted this can be done using style sheet. Syntax : button.setStyleSheet("border-style : dotted;") A 1 min read PyQt5 | How to create capsule shaped push button ? Capsule shape is basically shape which consist of one rectangle and two semi circle is connected to both the ends, in this tutorial we will see how to create these shaped button. Below is normal Push button vs capsule shaped push button. In order to create capsule shape button we have to do the foll 2 min read PyQt5 - Create circular Push Button In this article we will see how to create circular push button. By default, when we create a push button it is in rectangular form although we can also change it size to square. In order to create circular button we have to do following steps: 1. Create a push button. 2. Change its size to make it s 2 min read PyQt5 â Create multi-color border of StatusBar When we create border of a status bar it is of same color i.e all the edges are of same color. In this tutorial we will see how to create multi-colored borders i.e all the edges are of different color. In order to do this we will use setStyleSheet() method. Syntax : self.statusBar().setStyleSheet("b 2 min read PyQt5 - Dotted border of Radio Button In this article we will see how to create dotted border to the radio button. By default there is no border associated with the radio button although we can create border to it. Also we can edit the style sheet to make dotted border. Below is the representation of normal bordered radio button vs dott 2 min read PyQt5 â Set border to the Push button In this article we will see how to add border to Push Button. Although push button already have a border but that border is default. PyQt5 allows us to change the border of push button by using setStyleSheet method. Below is the example of push button with default border and customized border. Synta 1 min read Like