Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QProcess don't send signals.



  • #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



  • @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!



  • @JonB Thank's you !!


Log in to reply