PyQt5 – clearMessage() for StatusBar

PyQt5 supports a window status bar. This is a small bar at the bottom of a window that sometimes appears, it can contain text messages. clearMessage() method is used to clear the message set on the status bar which are set by showmessage() method.
Syntax : self.statusBar().clearMessage() Argument : It takes no argument. Action performed : It clears the message in status bar.
Code :
Python3
| fromPyQt5.QtCore import*fromPyQt5.QtGui import*fromPyQt5.QtWidgets import*importsysclassWindow(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("this isstatus bar")        # clearing the status bar message        self.statusBar().clearMessage()        # creating a label widget        self.label_1 =QLabel("No message instatus bar", self)        # moving position        self.label_1.move(100, 100)        # setting up the border        self.label_1.setStyleSheet("border :1pxsolid blue;")        # resizing label        self.label_1.adjustSize()        # show all the widgets        self.show()# create pyqt5 appApp =QApplication(sys.argv)# create the instance of our Windowwindow =Window()# start the appsys.exit(App.exec()) | 
Output : 
 
				 
					



