system_tray
_system_tray
¶
System tray icon widget.
Classes:
| Name | Description |
|---|---|
FXSystemTray |
A system tray icon with a context menu. |
Classes¶
FXSystemTray
¶
Bases: QObject
flowchart TD
fxgui.fxwidgets._system_tray.FXSystemTray[FXSystemTray]
click fxgui.fxwidgets._system_tray.FXSystemTray href "" "fxgui.fxwidgets._system_tray.FXSystemTray"
A system tray icon with a context menu.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
QWidget
|
The parent widget. Defaults to None. |
None
|
|
str
|
The icon path. Defaults to None. |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
tray_icon |
QSystemTrayIcon
|
The system tray icon. |
quit_action |
QAction
|
The action to quit the application. |
tray_menu |
QMenu
|
The tray menu. |
Methods:
| Name | Description |
|---|---|
show |
Shows the system tray icon. |
on_tray_icon_activated |
Shows the tray menu above the taskbar. |
closeEvent |
Closes the application. |
Examples:
>>> app = FXApplication()
>>> system_tray = FXSystemTray()
>>> hello_action = QAction(
... fxicons.get_icon("visibility"), "Set Project", system_tray
... )
>>> system_tray.tray_menu.insertAction(
... system_tray.quit_action, hello_action
... )
>>> system_tray.tray_menu.insertSeparator(system_tray.quit_action)
>>> system_tray.show()
>>> app.exec_()
Note
Inherits from QObject, not QSystemTrayIcon.