HulaLoop
Simple cross-platform audio loopback and recording.
SystemTrayIcon.h
1 #ifndef SYSTEMTRAYICON_H
2 #define SYSTEMTRAYICON_H
3 
4 #include <QMenu>
5 #include <QSystemTrayIcon>
6 
7 namespace hula
8 {
13  class SystemTrayIcon : public QObject {
14  Q_OBJECT
15 
16  private:
17  QSystemTrayIcon *trayIcon;
18  QMenu *trayIconMenu;
19 
20  public:
21  explicit SystemTrayIcon(QObject *parent = nullptr);
22 
23  Q_INVOKABLE void init();
24  Q_INVOKABLE void showMessage(const QString &, const QString &);
25  Q_INVOKABLE void setToolTip(const QString &);
26  Q_INVOKABLE void setDefaultIcon();
27  Q_INVOKABLE void setRecordIcon();
28  };
29 }
30 
31 #endif // SYSTEMTRAYICON_H
Q_INVOKABLE void init()
Initializes the system tray icon with a custom menu.
Definition: SystemTrayIcon.cpp:23
Q_INVOKABLE void setDefaultIcon()
Changes the system tray icon to the default image.
Definition: SystemTrayIcon.cpp:77
Class for communicating between QML and C++.
Definition: SystemTrayIcon.h:13
SystemTrayIcon(QObject *parent=nullptr)
Construct a new instance of the SystemTrayIcon class.
Definition: SystemTrayIcon.cpp:14
Q_INVOKABLE void showMessage(const QString &, const QString &)
Displays a balloon message with the provided title and message to the user.
Definition: SystemTrayIcon.cpp:59
Wrapper around translation functions for Qt.
Definition: Controller.h:10
Q_INVOKABLE void setRecordIcon()
Changes the system tray icon to the recording image.
Definition: SystemTrayIcon.cpp:85
Q_INVOKABLE void setToolTip(const QString &)
Changes the system tray icon tooltip text.
Definition: SystemTrayIcon.cpp:69