QProcess don't send signals.
Solved
General and Desktop
-
#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 executedprc->start("startApp");
(that does not wait, it just schedules it to start) you hitreturn 0;
, exitmain()
, 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!