call external executable file in Mac OS from QT
-
I ‘m trying to call an external executable file in Mac OS using DesktopServices , the executable name is
ABC.x, I can run the executable from Mac OS command line with ./ ABC.xBut cannot find a right way to call the executable from QT, I tried something as following, but it is not working
QProcess *process =new QProcess(this);
QString program="/Users/itadmin/Documents/ABC/ABC.x";
process->start(program,QStringList()<<"");the executable not launching. (No response) Please help.
-
I ‘m trying to call an external executable file in Mac OS using DesktopServices , the executable name is
ABC.x, I can run the executable from Mac OS command line with ./ ABC.xBut cannot find a right way to call the executable from QT, I tried something as following, but it is not working
QProcess *process =new QProcess(this);
QString program="/Users/itadmin/Documents/ABC/ABC.x";
process->start(program,QStringList()<<"");the executable not launching. (No response) Please help.
-
I ‘m trying to call an external executable file in Mac OS using DesktopServices , the executable name is
ABC.x, I can run the executable from Mac OS command line with ./ ABC.xBut cannot find a right way to call the executable from QT, I tried something as following, but it is not working
QProcess *process =new QProcess(this);
QString program="/Users/itadmin/Documents/ABC/ABC.x";
process->start(program,QStringList()<<"");the executable not launching. (No response) Please help.
@zhaobofu Why are you passing empty string as parameter?
Did you check http://doc.qt.io/qt-5/qprocess.html#errorOccurred ? -
QProcess more suitable for this. What error your getting when u QProcess?
-
QProcess more suitable for this. What error your getting when u QProcess?
@Chandras002 yes I tried, but there was no error at all!
-
@zhaobofu
In principle you have the right code, provided the path is correct.You will need to look through
QProcess
docs for code which lets you see errors, likeerror()
,readAllStandardError()
,errorOccurred()
, and similar.