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.
-
@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?
-
@Chandras002 yes I tried, but there was no error at all!
-
@JonB thanks I solved the problem by using QT to call a cs.command file, and cs.command calls the executable file.
QString program="Users/itadmin/Documents/det1/cs.command";
QDesktopServices::openUrl(QUrl("file:///"+program, QUrl::TolerantMode));