Object Detection  5.0
Image Processing Using Qt and Opencv
processhandler.cpp
1 #include "processhandler.h"
2 
3 ProcessHandler::ProcessHandler(QObject *parent) : QObject(parent)
4 {
5  setChildProcess(new QProcess(this));
6 
7 }
8 
9 void ProcessHandler::start(QString cmd, QStringList lst)
10 {
11  m_childProcess->start(cmd, lst);
12  emit started();
13 
14 }
15 
16 QProcess *ProcessHandler::childProcess() const
17 {
18  return m_childProcess;
19 }
20 
21 void ProcessHandler::setChildProcess(QProcess *childProcess)
22 {
23 // if(m_childProcess){
24 // m_childProcess->disconnect();
25 // delete m_childProcess;
26 // }
27  m_childProcess = childProcess;
28 // connect(m_childProcess, SIGNAL(finished(int)), this, SLOT(childFinished(int)));
29 // connect(m_childProcess, SIGNAL(finished(int)), m_childProcess, SLOT(deleteLater()));
30 // connect(m_childProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(redirecteOutput()));
31 // connect(m_port, SIGNAL(readyRead()), this, SLOT(redirecteInput()));
32 // connect(m_childProcess, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(childStatus(QProcess::ProcessState)));
33 
34 }