[Interest] Difference between QProcess::execute() and QProcess::start()

Thiago Macieira thiago.macieira at intel.com
Thu Sep 17 23:28:58 CEST 2015


On Thursday 17 September 2015 21:14:15 Joachim Langenbach wrote:
> Yeah, you're right! Actually I knew this difference alrady and because of
> the  asynchronous call I want to use the start() method, but it isn't
> working with the php executable, whereas the execute() method does. My
> guess is a different system environment or a problem with STDOUT, STDIN or
> STDERR.
> 
> But I want to proof it, that's why I asked for the differences.

int QProcess::execute(const QString &program, const QStringList &arguments)
{
    QProcess process;
    process.setReadChannelMode(ForwardedChannels);
    process.start(program, arguments);
    if (!process.waitForFinished(-1) || process.error() == FailedToStart)
        return -2;
    return process.exitStatus() == QProcess::NormalExit ? process.exitCode() : 
-1;
}

Any and all differences are there.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list