QCtrlSignals
1.0.0
A library to catch and handle windows and unix signals, in a cross platform manner
|
A library to catch and handle windows and unix signals, in a cross platform manner.
With this class, you can easily register for the Operation system signals (like CTRL_C_EVENT
on windows and SIGINT
on unix/linux) and use them just like normal Qt signals.
SIGINT
, SIGTERN
, ...)qApp->quit();
CTRL_CLOSE_EVENT
, which cannot be catched with the handler otherwiseJust copy the repository into you application (preferebly by adding it as a git submodule) and add the line include(./QCtrlSignals/qctrlsignals.pri)
to your .pro-file. This way all files and required libraries will automatically be added. Use #include <QCtrlSignals>
to access the class.
The following exaple uses the handler to:
CTRL_BREAK_EVENT
or SIGQUIT
)SigInt
(CTRL_C_EVENT
, SIGINT
) will print a messageBy default, QCtrlSignals prints some warning messages if something goes wrong (For example, a signal cannot be registered). All messages of QCtrlSignals are grouped into the QLoggingCategory "QCtrlSignals". If you want to simply disable the logging, call the folling function somewhere in your code:
For more information about all the things you can do with the logging categories, check the Qt-Documentation
The documentation is available as release and on github pages.
The documentation was created using doxygen. It includes an HTML-documentation and Qt-Help files that can be included into QtCreator (QtAssistant) to show F1-Help (See Adding External Documentation for more details).
SIGKILL
on linux cannot be registeredCTRL_CLOSE_EVENT
, cannot be registered