On domingo, 1 de julho de 2012 22.12.50, Phil wrote:
> {
>      QProcess myProcess;
>      QString str;
>
>      myProcess.start( "ls" );
>
>      if (!myProcess.waitForFinished())
>           qDebug() << "Make failed:" << myProcess.errorString();
>       else
>      {
>           qDebug() << "Make output:" << myProcess.readAll();
>
>           str = myProcess.readAll();
>           qDebug() << "string = " << str;
>
>          QByteArray array = myProcess.readAllStandardOutput();
>
>          qDebug() << "array size = " << array.size();
>
>      }
> }
>
> The string = "" and the array size = 0;

You're reading stdout three times: by default, read and readAll are connected
to stdout. Did you mean to readAllStandardError() in the second check?

I have to ask: are there any files to be listed in the current directory of the
application?

What showed up in the "Make output" line?
--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to