-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
helper class to send a signal to a process
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "systemutil.h" | ||
#include <signal.h> | ||
|
||
SystemUtil::SystemUtil(QObject *parent) { | ||
|
||
} | ||
|
||
void SystemUtil::pkill(uint pid, int signal) { | ||
kill(pid, signal); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#ifndef SYSTEMUTIL_H | ||
#define SYSTEMUTIL_H | ||
|
||
#include <QObject> | ||
|
||
class SystemUtilEnums : public QObject | ||
{ | ||
Q_OBJECT | ||
|
||
Q_ENUMS(Signals) | ||
|
||
public: | ||
enum Signals { | ||
SIGHUP = 1, | ||
SIGINT = 2, | ||
SIGQUIT = 3, | ||
SIGUSR1 = 10, | ||
SIGUSR2 = 12, | ||
SIGTERM = 15 | ||
}; | ||
}; | ||
|
||
class SystemUtil : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit SystemUtil(QObject *parent = 0); | ||
|
||
public slots: | ||
Q_INVOKABLE void pkill(uint pid, int signal); | ||
}; | ||
|
||
#endif // SYSTEMUTIL_H |