On 01/07/12 21:38, Thiago Macieira wrote:
>>
>> I had also tried start() but the output still goes to the console. Is it
>> possible to have the directory list inserted into a string or string list?
>
> Please show us the code you used when you used start().
{
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;
> By default, the stdout and stderr of a program launched from start() goes to
> the QProcess pipes and you can read it with the regular QIODevice and QProcess
> read functions.
>
> PS: you don't need ls to list a directory.
This is just a test example. I have a bash script that I want to add to
my code.
--
Regards,
Phil
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest