1 | // Copyright (C) 2017 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #include "sigtermhandler.h" |
5 | |
6 | #include <QTextStream> |
7 | |
8 | SigTermHandler *SigTermHandler::instance() |
9 | { |
10 | static auto inst = new SigTermHandler(); |
11 | return inst; |
12 | } |
13 | |
14 | void SigTermHandler::handle(int s) |
15 | { |
16 | QTextStream out(stdout); |
17 | out << " Caught signal "<< s << Qt::endl; |
18 | emit instance()->sigTermSignal(); |
19 | } |
20 | |
21 | SigTermHandler::~SigTermHandler() { } |
22 | |
23 | SigTermHandler::SigTermHandler(QObject *parent) : QObject(parent) { } |
24 |