PyQt5 – Set minimum length for width/height of Status Bar Last Updated : 26 Mar, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report When we create a status bar, by default, the status bar size is resizable. Although we can use setMinimumSize() method with status bar to set the minimum size of the status bar but what if we want to set minimum length for width or height only. In order to do, so we use setMinimumWidth() method with status bar to set minimum width and setMinimumHeight() method with status bar to set minimum height, when we use these method other length will be variable i.e there will be no minimum length to it, it can shrinks as much it can. Syntax : self.statusBar().setMinimumWidth(width) self.statusBar().setMinimumHeight(height) Argument : Both take integer as argument. Action performed : setMinimumWidth() sets the minimum width. setMinimumHeight() sets the minimum height. Code : Python3 1== 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("This is status bar") # setting border self.statusBar().setStyleSheet("border :3px solid black;") # setting minimum Height of status bar self.statusBar().setMinimumHeight(100) # 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 : Comment More infoAdvertise with us Next Article PyQt5 - Set fixed length for width/height of Status Bar R rakshitarora Follow Improve Article Tags : Python Python-PyQt Python-gui Practice Tags : python Similar Reads PyQt5 - Set fixed length for width/height of Status Bar When window is resized status bar also get resized although we can set a fix size of status bar by using setFixedSize method with object of status bar. In this article we will see how we can only fix the length of either width or height i.e other side would be variable. In order to fix length of wid 2 min read PyQt5 â Set maximum size for width or height of window When we create a window, by default the window size is resizable, although we can use setMaximumSize() method to set the maximum size of the window. But what if we want to set maximum length only for width or height only. In order to do so we use setMaximumWidth() and setMaximumHeight() method to se 2 min read PyQt5 â Set minimum size of Status Bar We know that we can resize the window of PyQt5 application but when we resize the window, status bar also get resized according to the size of window. While shrinking the window size we can set minimum size so that status bar canât be shrank any more. In this article, we will see how to do this, in 2 min read PyQt5 - Set maximum size of status bar We know by default when we resize the window, status bar also get resized. In this article we will see how to set the maximum size of the status bar i.e when we extend the window status bar should not extend beyond this size. In order to do this we will use setMaximumSize method with status bar obje 2 min read PyQt5 - Set minimum content length to ComboBox item In this article we will see how we can set the minimum length to the items of combo box i.e this property holds the minimum number of characters that should fit into the combo box. In order to do this we will use setMinimumContentsLength method, by default minimum length of combo box is 0. Syntax : 2 min read PyQt5 â Set status bar message in window In this article, we will see how to set message to status bar of window. A status bar is a graphical control element which poses an information area typically found at the window's bottom. It can be divided into sections to group information. Its job is primarily to display information about the cur 1 min read Like