QPlatformSystemTrayIcon Class
The QPlatformSystemTrayIcon class abstracts the system tray icon and interaction. More...
Header: | #include <QPlatformSystemTrayIcon> |
qmake: | QT += gui |
Public Types
enum | ActivationReason { Unknown, Context, DoubleClick, Trigger, MiddleClick } |
enum | MessageIcon { NoIcon, Information, Warning, Critical } |
Public Functions
virtual void | cleanup() = 0 |
virtual QRect | geometry() const = 0 |
virtual void | init() = 0 |
virtual bool | isSystemTrayAvailable() const = 0 |
virtual void | showMessage(const QString & msg, const QString & title, const QIcon & icon, MessageIcon iconType, int secs) = 0 |
virtual bool | supportsMessages() const = 0 |
virtual void | updateIcon(const QIcon & icon) = 0 |
virtual void | updateMenu(QPlatformMenu * menu) = 0 |
virtual void | updateToolTip(const QString & tooltip) = 0 |
Signals
void | activated(QPlatformSystemTrayIcon::ActivationReason reason) |
void | messageClicked() |
Detailed Description
The QPlatformSystemTrayIcon class abstracts the system tray icon and interaction.
See also QSystemTrayIcon.
Member Type Documentation
enum QPlatformSystemTrayIcon::ActivationReason
This enum describes the reason the system tray was activated.
Constant | Value | Description |
---|---|---|
QPlatformSystemTrayIcon::Unknown | 0 | Unknown reason |
QPlatformSystemTrayIcon::Context | 1 | The context menu for the system tray entry was requested |
QPlatformSystemTrayIcon::DoubleClick | 2 | The system tray entry was double clicked |
QPlatformSystemTrayIcon::Trigger | 3 | The system tray entry was clicked |
QPlatformSystemTrayIcon::MiddleClick | 4 | The system tray entry was clicked with the middle mouse button |
See also activated().
enum QPlatformSystemTrayIcon::MessageIcon
This enum describes the icon that is shown when a balloon message is displayed.
Constant | Value | Description |
---|---|---|
QPlatformSystemTrayIcon::NoIcon | 0 | No icon is shown. |
QPlatformSystemTrayIcon::Information | 1 | An information icon is shown. |
QPlatformSystemTrayIcon::Warning | 2 | A standard warning icon is shown. |
QPlatformSystemTrayIcon::Critical | 3 | A critical warning icon is shown. |
See also updateIcon(), showMessage(), and QMessageBox.
Member Function Documentation
void QPlatformSystemTrayIcon::activated(QPlatformSystemTrayIcon::ActivationReason reason) [signal]
This signal is emitted when the user activates the system tray icon. reason specifies the reason for activation.
See also QSystemTrayIcon::ActivationReason.
void QPlatformSystemTrayIcon::cleanup() [pure virtual]
This method is called to cleanup the platform dependent implementation.
QRect QPlatformSystemTrayIcon::geometry() const [pure virtual]
This method returns the geometry of the platform dependent system tray icon on the screen.
void QPlatformSystemTrayIcon::init() [pure virtual]
This method is called to initialize the platform dependent implementation.
bool QPlatformSystemTrayIcon::isSystemTrayAvailable() const [pure virtual]
Returns true if the system tray is available on the platform.
void QPlatformSystemTrayIcon::messageClicked() [signal]
This signal is emitted when the message displayed using showMessage() was clicked by the user.
See also activated().
void QPlatformSystemTrayIcon::showMessage(const QString & msg, const QString & title, const QIcon & icon, MessageIcon iconType, int secs) [pure virtual]
Shows a balloon message for the entry with the given title, message msg and icon for the time specified in secs. iconType is used as a hint for the implementing platform.
See also QSystemTrayIcon::showMessage().
bool QPlatformSystemTrayIcon::supportsMessages() const [pure virtual]
Returns true if the system tray supports messages on the platform.
void QPlatformSystemTrayIcon::updateIcon(const QIcon & icon) [pure virtual]
This method is called when the icon did change.
void QPlatformSystemTrayIcon::updateMenu(QPlatformMenu * menu) [pure virtual]
This method is called when the system tray menu did change.
void QPlatformSystemTrayIcon::updateToolTip(const QString & tooltip) [pure virtual]
This method is called when the tooltip text did change.