System Tray¶
A system tray icon widget for desktop integration.
FXSystemTray
¶
Bases:
A system tray icon with a context menu.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
|
The parent widget. Defaults to None. |
None
|
|
|
The icon path. Defaults to None. |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
|
|
The system tray icon. |
|
|
The action to quit the application. |
|
|
The tray menu. |
Methods:
| Name | Description |
|---|---|
|
Shows the system tray icon. |
|
Shows the tray menu above the taskbar. |
|
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.