#include "externalexecuter.h" #include ExternalExecuter::ExternalExecuter() { } ExternalExecuter::~ExternalExecuter() { } void ExternalExecuter::CallApp() { QProcess *myProcess = new QProcess(this); QStringList args; args << "1"; myProcess->start(programPath,args); myProcess->waitForFinished(3000); QCoreApplication::exit(); } bool ExternalExecuter::FindApp() { QString localPath = QDir::currentPath() + "/Application"; QDirIterator iterator(localPath,QDirIterator::Subdirectories); while(iterator.hasNext()){ iterator.next(); if(iterator.fileInfo().fileName() == "RRJ.exe"){ programPath = iterator.fileInfo().absoluteFilePath(); return true; } } return false; }