We can set message to a Status Bar by using showMessage() method. In this article, we will see how to change the font and the size of StatusBar message. In order to do this we will use setFont() method.
Syntax : self.statusBar().setFont(QFont(font_name, font_size))
Argument : It take two argument :
1. Font name it can be ‘Arial’, ’Times’ etc.
2. Size to be set in integer.Action performed : It changes the font and size of message
Code :
from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * import sys class Window(QMainWindow): def __init__(self): super().__init__() # set the title self.setWindowTitle("Python") # setting the geometry of window self.setGeometry(60, 60, 600, 400) # setting status bar message self.statusBar().showMessage("Times Font") # setting border self.statusBar().setStyleSheet("border :3px solid black;") # setting font and size self.statusBar().setFont(QFont('Times', 15)) # creating a label widget self.label_1 = QLabel("Status bar", self) # moving position self.label_1.move(100, 100) # setting up the border self.label_1.setStyleSheet("border :1px solid blue;") # resizing label self.label_1.adjustSize() # show all the widgets self.show() # create pyqt5 app App = QApplication(sys.argv) # create the instance of our Window window = Window() # start the app sys.exit(App.exec()) |
Output :

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.
Recommended Posts:
- PyQt5 - Visibility status of Status Bar
- PyQt5 – Set status bar message in window
- PyQt5 – Set minimum size of Status Bar
- PyQt5 - Access the size of Status Bar
- PyQt5 – Setting padding size at different sides of Status Bar
- PyQt5 - Set maximum size of status bar
- PyQt5 – Setting and accessing description of a Status Bar
- PyQt5 – Setting and accessing name of a Status Bar
- PyQt5 – Setting and accessing WHATS THIS help text for Status Bar
- PyQt5 – How to change font and size of Label text ?
- PyQt5 – Change the text font and size in Push button
- PyQt5 – Add border to status bar
- PyQt5 – Set color to a status bar
- PyQt5 – Create dashed border of status bar
- PyQt5 – Set minimum length for width/height of Status Bar
- PyQt5 - Access tool tip data of Status Bar
- PyQt5 - Access tool tip duration of Status Bar
- PyQt5 - Set tool tip duration to Status bar
- PyQt5 - Set tool tip to Status Bar
- PyQt5 – Set skin to Status Bar
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

