一、说明
QT提供了一个QProcess类用于启动一个外部程序并与之通信。
二、区别
void QProcess::start(const QString &program, const QStringList &arguments, QIODevice::OpenMode mode = ReadWrite)
Starts the given program in a new process, passing the command line arguments in arguments.
[static] int QProcess::execute(const QString &program, const QStringList &arguments)
Starts the program program with the arguments arguments in a new process, waits for it to finish, and then returns the exit code of the process. Any data the new process writes to the console is forwarded to the calling process.
三、结论
start: 非阻塞方式调用
execute: 阻塞方式调用
execute() = start()+waitforFinished()