PySide6.QtWidgets.QStatusBar¶
- class QStatusBar¶
- The - QStatusBarclass provides a horizontal bar suitable for presenting status information. More…- Synopsis¶- Properties¶- sizeGripEnabledᅟ- Whether the QSizeGrip in the bottom-right corner of the status bar is enabled
 - Methods¶- def - __init__()
- def - addWidget()
- def - currentMessage()
- def - hideOrShow()
- def - insertWidget()
- def - reformat()
- def - removeWidget()
 - Slots¶- def - clearMessage()
- def - showMessage()
 - Signals¶- def - messageChanged()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- Warning - This section contains snippets that were automatically translated from C++ to Python and may contain errors. - Each status indicator falls into one of three categories: - Temporary - briefly occupies most of the status bar. Used to explain tool tip texts or menu entries, for example. 
- Normal - occupies part of the status bar and may be hidden by temporary messages. Used to display the page and line number in a word processor, for example. 
- Permanent - is never hidden. Used for important mode indications, for example, some applications put a Caps Lock indicator in the status bar. 
 - QStatusBarlets you display all three types of indicators.- Typically, a request for the status bar functionality occurs in relation to a - QMainWindowobject.- QMainWindowprovides a main application window, with a menu bar, tool bars, dock widgets and a status bar around a large central widget. The status bar can be retrieved using the- statusBar()function, and replaced using the- setStatusBar()function.- Use the - showMessage()slot to display a temporary message:- statusBar().showMessage(tr("Ready")) - To remove a temporary message, use the - clearMessage()slot, or set a time limit when calling- showMessage(). For example:- statusBar().showMessage(tr("Ready"), 2000) - Use the - currentMessage()function to retrieve the temporary message currently shown. The- QStatusBarclass also provide the- messageChanged()signal which is emitted whenever the temporary status message changes.- Normal and Permanent messages are displayed by creating a small widget ( - QLabel,- QProgressBaror even- QToolButton) and then adding it to the status bar using the- addWidget()or the- addPermanentWidget()function. Use the- removeWidget()function to remove such messages from the status bar.- statusBar().addWidget(MyReadWriteIndication()) - By default - QStatusBarprovides a- QSizeGripin the lower-right corner. You can disable it using the- setSizeGripEnabled()function. Use the- isSizeGripEnabled()function to determine the current status of the size grip.  - See also - Note - Properties can be used directly when - from __feature__ import true_propertyis used or via accessor functions otherwise.- property sizeGripEnabledᅟ: bool¶
 - This property holds whether the - QSizeGripin the bottom-right corner of the status bar is enabled.- The size grip is enabled by default. - Access functions:
 - Constructs a status bar with a size grip and the given - parent.- See also - Adds the given - widgetpermanently to this status bar, reparenting the widget if it isn’t already a child of this- QStatusBarobject. The- stretchparameter is used to compute a suitable size for the given- widgetas the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.- Permanently means that the widget may not be obscured by temporary messages. It is located at the far right of the status bar. - Adds the given - widgetto this status bar, reparenting the widget if it isn’t already a child of this- QStatusBarobject. The- stretchparameter is used to compute a suitable size for the given- widgetas the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.- The widget is located to the far left of the first permanent widget (see - addPermanentWidget()) and may be obscured by temporary messages.- clearMessage()¶
 - Removes any temporary message being shown. - See also - currentMessage()¶
- Return type:
- str 
 
 - Returns the temporary message currently shown, or an empty string if there is no such message. - See also - hideOrShow()¶
 - Ensures that the right widgets are visible. - Used by the - showMessage()and- clearMessage()functions.- insertPermanentWidget(index, widget[, stretch=0])¶
- Parameters:
- index – int 
- widget – - QWidget
- stretch – int 
 
- Return type:
- int 
 
 - Inserts the given - widgetat the given- indexpermanently to this status bar, reparenting the widget if it isn’t already a child of this- QStatusBarobject. If- indexis out of range, the widget is appended (in which case it is the actual index of the widget that is returned).- The - stretchparameter is used to compute a suitable size for the given- widgetas the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.- Permanently means that the widget may not be obscured by temporary messages. It is located at the far right of the status bar. - insertWidget(index, widget[, stretch=0])¶
- Parameters:
- index – int 
- widget – - QWidget
- stretch – int 
 
- Return type:
- int 
 
 - Inserts the given - widgetat the given- indexto this status bar, reparenting the widget if it isn’t already a child of this- QStatusBarobject. If- indexis out of range, the widget is appended (in which case it is the actual index of the widget that is returned).- The - stretchparameter is used to compute a suitable size for the given- widgetas the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.- The widget is located to the far left of the first permanent widget (see - addPermanentWidget()) and may be obscured by temporary messages.- isSizeGripEnabled()¶
- Return type:
- bool 
 
 - Getter of property - sizeGripEnabledᅟ.- messageChanged(text)¶
- Parameters:
- text – str 
 
 - This signal is emitted whenever the temporary status message changes. The new temporary message is passed in the - messageparameter which is a null-string when the message has been removed.- See also - reformat()¶
 - Changes the status bar’s appearance to account for item changes. - Special subclasses may need this function, but geometry management will usually take care of any necessary rearrangements. - Removes the specified - widgetfrom the status bar.- Note - This function does not delete the widget but hides it. To add the widget again, you must call both the - addWidget()and- show()functions.- setSizeGripEnabled(arg__1)¶
- Parameters:
- arg__1 – bool 
 - See also 
 - Setter of property - sizeGripEnabledᅟ.- showMessage(text[, timeout=0])¶
- Parameters:
- text – str 
- timeout – int 
 
 
 - Hides the normal status indications and displays the given - messagefor the specified number of milli-seconds (- timeout). If- timeoutis 0 (default), the- messageremains displayed until the- clearMessage()slot is called or until the showMessage() slot is called again to change the message.- Note that showMessage() is called to show temporary explanations of tool tip texts, so passing a - timeoutof 0 is not sufficient to display a- permanent message.