Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Italian
  4. Lanciare una funzione QT usando un segnale UNIX/LINUX
Forum Updated to NodeBB v4.3 + New Features

Lanciare una funzione QT usando un segnale UNIX/LINUX

Scheduled Pinned Locked Moved Italian
2 Posts 1 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • gfxxG Offline
    gfxxG Offline
    gfxx
    wrote on last edited by
    #1

    "tutorial per 4.8-4.7":https://qt-project.org/doc/qt-4.7/unix-signals.html .... seppure ben fatto a causa di una mia inesistente esperienza con i segnali unix non ho capito bene l'utilizzo del codice .....

    @ static int setup_unix_signal_handlers()
    {
    struct sigaction hup, term;

        hup.sa_handler = MyDaemon::hupSignalHandler;
        sigemptyset(&hup.sa_mask);
        hup.sa_flags = 0;
        hup.sa_flags |= SA_RESTART;
     
        if (sigaction(SIGHUP, &hup, 0) > 0)
           return 1;
     
        term.sa_handler = MyDaemon::termSignalHandler;
        sigemptyset(&term.sa_mask);
        term.sa_flags |= SA_RESTART;
     
        if (sigaction(SIGTERM, &term, 0) > 0)
           return 2;
     
        return 0;
    }
    

    @

    per esempio il tutorial dice che dovrei inserire questo codice nel mio di inizializzazione dei segnali unix (spero di avere capito bene) ..... ma se volessi semplicemente lanciare il segnale da shell con il comando @kill -s SIGTERM miopid@ ???

    Anzi questo è proprio quello che cerco di fare .... lanciare una funzione QT a partire da un segnale UNIX ... precisamente SIGUSR1 .... da shell ...... sucessivamente lo stesso verrà lanciato da un programma in C puro.

    Qualsiasi tipo di aiuto sarà ben accetto ... grazie a tutti in anticipo.

    bkt

    1 Reply Last reply
    0
    • gfxxG Offline
      gfxxG Offline
      gfxx
      wrote on last edited by
      #2

      up!!

      bkt

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved