QPlatformSystemTrayIcon Class

The QPlatformSystemTrayIcon class abstracts the system tray icon and interaction. More...

#include <QPlatformSystemTrayIcon>

Inherits: QObject.

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
  • 31 public functions inherited from QObject

Signals

void activated(QPlatformSystemTrayIcon::ActivationReason reason)
void messageClicked()

Additional Inherited Members

  • 1 property inherited from QObject
  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 9 static public members inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QPlatformSystemTrayIcon class abstracts the system tray icon and interaction.

See also QSystemTray.

Member Type Documentation

enum QPlatformSystemTrayIcon::ActivationReason

This enum describes the reason the system tray was activated.

ConstantValueDescription
QPlatformSystemTrayIcon::Unknown0Unknown reason
QPlatformSystemTrayIcon::Context1The context menu for the system tray entry was requested
QPlatformSystemTrayIcon::DoubleClick2The system tray entry was double clicked
QPlatformSystemTrayIcon::Trigger3The system tray entry was clicked
QPlatformSystemTrayIcon::MiddleClick4The 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.

ConstantValueDescription
QPlatformSystemTrayIcon::NoIcon0No icon is shown.
QPlatformSystemTrayIcon::Information1An information icon is shown.
QPlatformSystemTrayIcon::Warning2A standard warning icon is shown.
QPlatformSystemTrayIcon::Critical3A 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.