nikhilqt
11th November 2010, 13:30
Hi,
I have a issue in setting the QProcess to run executable with the arguments. The Qt code for the same is as below,
QProcess* processSQLDB = new QProcess(this);
// some path where i require the output
processSQLDB->setWorkingDirectory(sToolAccessfilepath);
QString sExeName = "\"D:/app 1/app.exe\"";
QStringList sArgs;
sArgs << "DBFile.db";
sArgs << "<";
sArgs << sDataFileName;
processSQLDB->start( sExeName , sArgs);
if (!processSQLDB->waitForStarted())
return false;
// to display stdout, stderr,this gives an empty string
qDebug() << processSQLDB->readAll();
The output of this snippet is the creation of the file "DBFile.db". But it is not happening. Am i doing any mistake?
But if i goto cmd prompt and execute the same thing like.,
c:/> "D:/app 1/app.exe" DBFile.db < sDataFileName. This works perfectly.
I have a issue in setting the QProcess to run executable with the arguments. The Qt code for the same is as below,
QProcess* processSQLDB = new QProcess(this);
// some path where i require the output
processSQLDB->setWorkingDirectory(sToolAccessfilepath);
QString sExeName = "\"D:/app 1/app.exe\"";
QStringList sArgs;
sArgs << "DBFile.db";
sArgs << "<";
sArgs << sDataFileName;
processSQLDB->start( sExeName , sArgs);
if (!processSQLDB->waitForStarted())
return false;
// to display stdout, stderr,this gives an empty string
qDebug() << processSQLDB->readAll();
The output of this snippet is the creation of the file "DBFile.db". But it is not happening. Am i doing any mistake?
But if i goto cmd prompt and execute the same thing like.,
c:/> "D:/app 1/app.exe" DBFile.db < sDataFileName. This works perfectly.