KSignalHandler Class
Allows getting ANSI C signals and forward them onto the Qt eventloop. More...
- Header:
#include <KSignalHandler> - CMake:
find_package(KF6 REQUIRED COMPONENTS CoreAddons)
target_link_libraries(mytarget PRIVATE KF6::CoreAddons) - Inherits: QObject
List of all members, including inherited members
Public Functions
Signals
Static Public Members
Detailed Description
It's a singleton as it relies on static data getting defined.
{
KSignalHandler::self()->watchSignal(SIGTERM);
connect(KSignalHandler::self(), &KSignalHandler::signalReceived,
this, &SomeClass::handleSignal);
job->start();
}
Member Function Documentation
[static] KSignalHandler *KSignalHandler::self()
Fetches an instance we can use to register our signals.
[signal] void KSignalHandler::signalReceived(int signal)
Notifies that signal is emitted.
To catch a signal, we need to make sure it's registered using @m watchSignal.
See also watchSignal
void KSignalHandler::watchSignal(int signal)
Adds signal to be watched for. Once the process is notified about this signal, @m signalReceived will be emitted with the same signal as an argument.
See also signalReceived