简体   繁体   中英

QT Creator QProcess

I want to run a fortran executable that is called when I click in push button in the interface that I created.

Although when I click in the button nothing happens. Here is the code:

QProcess *process = new QProcess(this);
QString program = QDir::currentPath() + "/PARROT/Console1.exe";
process->start(program);

The string is in that way because I want to be capable of changing the path to the main executable and the fortran executable.

What I'm doing wrong?

Check this link - QProcess Start command syntax

syntax - void QProcess::start(const QString & program, const QStringList & arguments, OpenMode mode = ReadWrite)

You need to pass the argumentlist as 2nd parameter,along with the process path as 1st parameter, needed to start the process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM