123456789101112131415161718192021222324252627282930313233 |
- #ifndef SIGNALMANAGER_H
- #define SIGNALMANAGER_H
- #include <QObject>
- #include <QSocketNotifier>
- #include <QGuiApplication>
- class SignalManager : public QObject
- {
- Q_OBJECT
- public:
- explicit SignalManager(QGuiApplication* app);
- ~SignalManager() override {}
-
- static void signalHandler(int signal_num);
- int setupHandlers();
- void closeApplication();
- public slots:
-
- void handleSignal();
- private:
- static int g_sigtermFd[2];
- QSocketNotifier* m_snTerm;
- QGuiApplication* m_app;
- };
- #endif
|