Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QProcess don't send signals.
Forum Updated to NodeBB v4.3 + New Features

QProcess don't send signals.

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 553 Views
  • 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.
  • A Offline
    A Offline
    Anton Shelenkov
    wrote on last edited by Anton Shelenkov
    #1

    #include <QProcess>
    #include <QObject>
    #include <QDebug>

    int main()
    {
    auto prc = new QProcess();

    QObject::connect( prc, &QProcess::started, []()
    {
        qDebug () << "Process started!";
    });
    
    prc->start("startApp");
    
    return 0;
    

    }

    Process started, but don't send signal.

    Qt 5.10.1
    OS Ubuntu 16.04
    GCC

    JonBJ 1 Reply Last reply
    0
    • A Anton Shelenkov

      #include <QProcess>
      #include <QObject>
      #include <QDebug>

      int main()
      {
      auto prc = new QProcess();

      QObject::connect( prc, &QProcess::started, []()
      {
          qDebug () << "Process started!";
      });
      
      prc->start("startApp");
      
      return 0;
      

      }

      Process started, but don't send signal.

      Qt 5.10.1
      OS Ubuntu 16.04
      GCC

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Anton-Shelenkov
      As soon as you have executed prc->start("startApp"); (that does not wait, it just schedules it to start) you hit return 0;, exit main(), and exit your Qt app. So what do you expect?! You need to wait around in some shape or form in your app (letting the Qt event loop run) till the process starts/exits if you expect to receive any signals!

      A 1 Reply Last reply
      4
      • JonBJ JonB

        @Anton-Shelenkov
        As soon as you have executed prc->start("startApp"); (that does not wait, it just schedules it to start) you hit return 0;, exit main(), and exit your Qt app. So what do you expect?! You need to wait around in some shape or form in your app (letting the Qt event loop run) till the process starts/exits if you expect to receive any signals!

        A Offline
        A Offline
        Anton Shelenkov
        wrote on last edited by
        #3

        @JonB Thank's you !!

        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