Giter VIP home page Giter VIP logo

qt-unix-signals's People

Contributors

kosmaz avatar sijk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qt-unix-signals's Issues

When using QApplication, unix signals are not raised on Embedded Linux.(QT 5.5)

When using QCoreApplication in main() as suggested in example.cc, the code works fine.
But if i change QCoreApplication to QApplication (as i am using UI), unix signals are not raised.

The application works fine on Desktop.
The above issue is with Embedded Linux.

I see that QT internally blocked the signals SIGINT, SIGTERM to route it to socket. (using signalfd()).

can i call sigprocmask with SIG_UNBLOCK in my handler to emit the signal.
(If i do it signal is emitted successfully)

Will there be any side-effects on QT Application if i set it directly.

a copy-paste bug in UnixSignalWatcherPrivate::watchForSignal

Thanks for a great piece of code!
There is only couple of problems:

  1. You seem to forget to copy the sa_flags=0 initialization from the Qt example.
    In my case it leads to not restoring the handler after the first call, time to time.
  2. I am not sure why did Qt people use sigemptyset in the original example.
    Possibly, they wanted to add the signals later with sigaddset, but forgot about it.
    Anyway, now your handler is not protected from any signal to arrive during its
    execution. I doubt it's the desired effect.

Add CMake buildsystem support

I thought it would be useful to add support for projects build with CMake.
This will result in an easy and automated way to include qt-unix-signal into your own QT project build with CMake.
I will make a PR today and link it as an answer to this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.