#include <trayicon.h>
Signals | |
void | doubleClicked () |
Public Member Functions | |
TrayIcon () | |
void | show () |
void | hide () |
void | update (const QString &iconFile, const QString &toolTip) |
void | setToolTip (const QString &toolTip) |
void | setIcon (const QString &iconFile) |
void | setContextMenu (QMenu *contextMenu) |
Protected Member Functions | |
bool | event (QEvent *) |
void | mouseButtonPress (QMouseEvent *event) |
void | mouseButtonRelease (QMouseEvent *event) |
void | mouseButtonDblClick (QMouseEvent *event) |
Private Attributes | |
QMenu * | _contextMenu |
Definition at line 46 of file trayicon.h.
TrayIcon::TrayIcon | ( | ) |
void TrayIcon::show | ( | ) |
Show the tray icon.
Call the platform's tray icon implementation to show the tray icon.
Reimplemented from TrayIconImpl.
Definition at line 120 of file trayicon.cpp.
References TrayIconImpl::show().
Referenced by MainWindow::MainWindow().
void TrayIcon::hide | ( | ) |
Hide the tray icon.
Call the platform's tray icon implementation to hide the tray icon.
Reimplemented from TrayIconImpl.
Definition at line 127 of file trayicon.cpp.
References TrayIconImpl::hide().
Referenced by MainWindow::~MainWindow().
void TrayIcon::update | ( | const QString & | iconFile, | |
const QString & | toolTip | |||
) |
Updates the icon image and tooltip.
Update the tray icon's image and tooltip.
Definition at line 112 of file trayicon.cpp.
References setIcon(), and setToolTip().
void TrayIcon::setToolTip | ( | const QString & | toolTip | ) |
Update the tray icon's tooltip.
Call the platform's tray icon implementation to update the icon's tooltip.
Reimplemented from TrayIconImpl.
Definition at line 134 of file trayicon.cpp.
References TrayIconImpl::setToolTip().
Referenced by update(), and MainWindow::updateTorStatus().
void TrayIcon::setIcon | ( | const QString & | iconFile | ) |
Update the tray icon's image.
Call the platform's tray icon implementation to update the icon image.
Reimplemented from TrayIconImpl.
Definition at line 141 of file trayicon.cpp.
References TrayIconImpl::setIcon().
Referenced by update(), and MainWindow::updateTorStatus().
void TrayIcon::setContextMenu | ( | QMenu * | menu | ) |
Sets the context menu displayed when the tray icon is selected.
Sets the context menu displayed when the tray icon is selected. On Mac, the context menu is displayed when the dock icon is clicked.
Definition at line 149 of file trayicon.cpp.
References _contextMenu.
Referenced by MainWindow::createTrayIcon().
void TrayIcon::doubleClicked | ( | ) | [signal] |
Emitted when the user double-clicks on the tray icon.
Referenced by mouseButtonDblClick().
bool TrayIcon::event | ( | QEvent * | event | ) | [protected] |
Override's QObject' event() method to catch mouse-related events.
Catches and handles mouse-related events.
Definition at line 45 of file trayicon.cpp.
References mouseButtonDblClick(), mouseButtonPress(), and mouseButtonRelease().
void TrayIcon::mouseButtonPress | ( | QMouseEvent * | event | ) | [protected] |
Respond to a mouse button being pressed.
Responds to a single mouse button press. On X11, we display the menu when a mouse button is pressed.
Definition at line 70 of file trayicon.cpp.
References _contextMenu.
Referenced by event().
void TrayIcon::mouseButtonRelease | ( | QMouseEvent * | event | ) | [protected] |
Respond to a mouse button being released.
Responds to a single mouse button release. On Windows, we display the menu when a mouse button is released.
Definition at line 84 of file trayicon.cpp.
References _contextMenu.
Referenced by event().
void TrayIcon::mouseButtonDblClick | ( | QMouseEvent * | event | ) | [protected] |
Respond to a mouse button being double-clicked.
Responds to a mouse button double-click. On all platforms, we just emit a signal and let the owner of the tray icon decide if they want to do anything.
Definition at line 103 of file trayicon.cpp.
References doubleClicked().
Referenced by event().
QMenu* TrayIcon::_contextMenu [private] |
Menu to display when the tray icon is clicked.
Definition at line 82 of file trayicon.h.
Referenced by mouseButtonPress(), mouseButtonRelease(), setContextMenu(), and TrayIcon().