2020-06-27 07:04:56 +00:00
|
|
|
#include <myx/qt/posix_signal_watcher.hpp>
|
|
|
|
|
|
|
|
#include <QCoreApplication>
|
|
|
|
#include <QDebug>
|
|
|
|
|
|
|
|
namespace MQ = myx::qt;
|
|
|
|
|
|
|
|
int main( int argc, char* argv[] )
|
|
|
|
{
|
|
|
|
QCoreApplication app( argc, argv );
|
|
|
|
qDebug() << "Hello from process" << QCoreApplication::applicationPid();
|
|
|
|
|
|
|
|
MQ::PosixSignalWatcher sigwatch;
|
|
|
|
sigwatch.watchForSignal( SIGINT );
|
|
|
|
sigwatch.watchForSignal( SIGTERM );
|
|
|
|
QObject::connect( &sigwatch, &MQ::PosixSignalWatcher::posixSignal, &app, &QCoreApplication::quit );
|
|
|
|
|
2020-06-30 17:04:26 +00:00
|
|
|
int exitcode = QCoreApplication::exec();
|
2020-06-27 07:04:56 +00:00
|
|
|
qDebug() << "Goodbye";
|
|
|
|
return( exitcode );
|
|
|
|
}
|