Status Bar¶
An enhanced status bar with additional features and styling.
Preview
FXStatusBar
¶
Bases: ,
Customized QStatusBar class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
|
Parent widget. Defaults to |
None
|
|
|
Project name. Defaults to |
None
|
|
|
Version information. Defaults to |
None
|
|
|
Company name. Defaults to |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
|
|
The project name. |
|
|
The version string. |
|
|
The company name. |
|
|
The icon label. |
|
|
The message label. |
|
|
The project label. |
|
|
The version label. |
|
|
The company label. |
Methods:
| Name | Description |
|---|---|
|
Clears the message from the status bar. |
|
Hide the status line and border line. |
|
Handle resize to position the status line and border correctly. |
|
Set the status line gradient colors. |
|
Display a message in the status bar with a specified severity. |
|
Show the status line and border line. |
clearMessage
¶
Clears the message from the status bar.
Note
Overrides the base class method.
resizeEvent
¶
Handle resize to position the status line and border correctly.
set_status_line_colors
¶
showMessage
¶
showMessage(
message : str ,
severity_type : int = 4,
duration : float = 2.5,
time : bool = True,
logger : Optional [Logger ] = None,
set_color : bool = True,
pixmap : Optional [QPixmap ] = None,
background_color : Optional [str ] = None,
)
Display a message in the status bar with a specified severity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
|
The message to be displayed. |
required |
|
|
The severity level of the message.
Should be one of |
4
|
|
|
The duration in seconds for which
the message should be displayed. Defaults to |
2.5
|
|
|
Whether to display the current time before
the message. Defaults to |
True
|
|
|
A logger object to log the message.
Defaults to |
None
|
|
|
Whether to set the status bar color depending on
the log verbosity. Defaults to |
True
|
|
|
A custom pixmap to be displayed in the
status bar. Defaults to |
None
|
|
|
A custom background color for
the status bar. Defaults to |
None
|
Examples:
To display a critical error message with a red background
>>> self.showMessage(
... "Critical error occurred!",
... severity_type=self.CRITICAL,
... duration=5,
... logger=my_logger,
... )
Note
You can either use the FXMainWindow instance to retrieve the
verbosity constants, or the fxwidgets module.
Overrides the base class method.