QProcess not emitting any signals
-
Hello,
I'm developing a GUI application that would execute an external command line executable. I have connected some of the signals to slots, but I find that none of the signals are emitting even though I see output from the "Application Output" window whilst debugging.Here's some part of my code:
//MainWindowUi.h private slots: void process_started(); void process_output(); private: QProcess *process;
//MainWindowUi.cpp MainWindowUi::MainWindowUi(QWidget *parent) : QMainWindow(parent), ui(new Ui::BTDProgrammerUI) { ui->setupUi(this); process = new QProcess(this); connect(process, SIGNAL(readyReadStandardOutput()), this, SLOT(process_output())); } void MainWindowUi::process_output() { // Not executing here QByteArray processOutput; processOutput = process->readAllStandardOutput(); qDebug() << QString(processOutput); }
I've tried other signals (e.g. start/finished) but they aren't being emitted as well.
Any ideas where I went wrong?
Thanks
-
I started the process in a slot of a button's click signal
process->startDetached(exe, args);
I would not expect that startDetached can support all signals or if any at all.
You can even exit the calling program and the detached application with continue to run.When you like to have signals transmitted you need to use start or the overloaded version.
-
Where do you start your executable you want to start with QProcess?
-
I started the process in a slot of a button's click signal
process->startDetached(exe, args);
I would not expect that startDetached can support all signals or if any at all.
You can even exit the calling program and the detached application with continue to run.When you like to have signals transmitted you need to use start or the overloaded version.
-
I would not expect that startDetached can support all signals or if any at all.
You can even exit the calling program and the detached application with continue to run.When you like to have signals transmitted you need to use start or the overloaded version.