c++ - QProcess claims process exited when process is still running -


i starting external gui application in linux qthread, using qprocess. process enters starting state (qprocess::starting), enters running state (qprocess::running), then, afterward, enters stopped state (qprocess::notrunning, verified slot connected statechanged(qprocess::processstate) signal). qprocess::errorstring() returns "unknown error." external process still running, qprocess object doesn't show running.

this happens applications, have found dolphin file manager , xterm not exhibit behavior. it's possible there others work well. using qt 5.4.0 debian 8.2 jessie, gcc 4.9.2.

does know why happen? unfortunately, unable post complete example, require posting entire application.

class recordingcontrollerobject : public qobject {     q_object  public:     recordingcontrollerobject(qobject *parent = 0)         : qobject(parent)         ...         , proc(new qprocess(this))         ...     {         ...         connect(proc, signal(statechanged(qprocess::processstate)), slot(procstatechanged(qprocess::processstate)));         ...     }     virtual ~recordingcontrollerobject()     {         ...         if (proc->state() == qprocess::running)         {             proc->terminate();             proc->waitforfinished(-1);         }         delete proc;         ...     }      ...  signals:     ...  public slots:     ...      void startwatcher(const qstring &program, const qstringlist &arguments)     {         qdebug("starting watcher\n");         if (proc->state() == qprocess::running)             proc->kill();         proc->start(program, arguments);     }  private slots:     void readyread(const qbytearray &buffer)     {         if (proc->isopen())             proc->write(buffer);     }      void procstatechanged(qprocess::processstate state)     {         std::cout << "proc state changed: " << state << std::endl;         std::cout << "proc error: " << proc->errorstring().toutf8().constdata() << std::endl;     }      ...  private:     ...     qprocess *proc;     ... }; 


Comments