QtPass 1.4.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
trayicon.h
Go to the documentation of this file.
1#ifndef TRAYICON_H_
2#define TRAYICON_H_
3
4#include <QSystemTrayIcon>
5#include <QWidget>
6
11class QAction;
12class QMainWindow;
13class QMenu;
14class TrayIcon : public QWidget {
15 Q_OBJECT
16
17public:
18 explicit TrayIcon(QMainWindow *parent);
19 void showMessage(const QString &title, const QString &msg, int time);
20 void setVisible(bool visible);
21 bool getIsAllocated();
22
23signals:
24
25public slots:
26 void showHideParent();
27 void iconActivated(QSystemTrayIcon::ActivationReason reason);
28
29private:
30 void createActions();
31 void createTrayIcon();
32
33 QAction *showAction;
34 QAction *hideAction;
35 QAction *minimizeAction;
36 QAction *maximizeAction;
37 QAction *restoreAction;
38 QAction *quitAction;
39
40 QSystemTrayIcon *sysTrayIcon;
41 QMenu *trayIconMenu;
42 QMainWindow *parentwin;
43
44 bool isAllocated;
45};
46
47#endif // TRAYICON_H_
Handles the systemtray icon and menu.
Definition: trayicon.h:14
void showHideParent()
TrayIcon::showHideParent toggle app visibility.
Definition: trayicon.cpp:101
void iconActivated(QSystemTrayIcon::ActivationReason reason)
TrayIcon::iconActivated you clicked on the trayicon.
Definition: trayicon.cpp:112
void showMessage(const QString &title, const QString &msg, int time)
TrayIcon::showMessage show a systray message for notification.
Definition: trayicon.cpp:132
bool getIsAllocated()
TrayIcon::getIsAllocated return if TrayIcon is allocated.
Definition: trayicon.cpp:57
void setVisible(bool visible)
TrayIcon::setVisible show or hide the icon.
Definition: trayicon.cpp:47