|  | Home · Overviews · Examples

# QSystemTrayIcon Class Reference
[com.trolltech.qt.gui module]

The `QSystemTrayIcon` class provides an icon for an application in the system tray. More...

Inherits `QObject`.

## Detailed Description

The `QSystemTrayIcon` class provides an icon for an application in the system tray.

Modern operating systems usually provide a special area on the desktop, called the system tray or notification area, where long-running applications can display icons and short messages.

The `QSystemTrayIcon` class can be used on the following platforms:

- All supported versions of Windows.
- All window managers for X11 that implement the freedesktop.org system tray specification, including recent versions of KDE and GNOME.
- All supported version of Mac OS X. QSystemTrayIcon::showMessage() requires Growl to display messages.

To check whether a system tray is present on the user's desktop, call the QSystemTrayIcon::isSystemTrayAvailable() static function.

To add a system tray entry, create a `QSystemTrayIcon` object, call `setContextMenu` to provide a context menu for the icon, and call `show` to make it visible in the system tray. Status notification messages ("balloon messages") can be displayed at any time using `showMessage`.

If the system tray is unavailable when a system tray icon is constructed, but becomes available later, `QSystemTrayIcon` will automatically add an entry for the application in the system tray if the icon is visible.

The `activated` signal is emitted when the user activates the icon.

Only on X11, when a tooltip is requested, the `QSystemTrayIcon` receives a `QHelpEvent` of type QEvent::ToolTip. Additionally, the `QSystemTrayIcon` receives wheel events of type QEvent::Wheel. These are not supported on any other platform.

See also `QDesktopServices`, `QDesktopWidget`, Desktop Integration, and System Tray Icon Example.