Hi Franco,
you can reuse QProcess instance but you have to wait until each external program terminates.
Hi Franco,
you can reuse QProcess instance but you have to wait until each external program terminates.
A camel can go 14 days without drink,
I can't!!!
And please, don't use a loop. The magic word is Signal&Slots: QProcess::finished().
Hi Lykurg,
thank you very much. So once the external process has finished I can call it again with a new argument right ( in my case a QStringList containing a list of mp3 files )? So the process is not destroyed once the external program has finished? I have to destroy it manually?
@mcosta: I didn't get you. Why I have to wait that each external program terminates to reuse the process?
I would reuse it once the last is finished.
So something like this is not correct?
QString program = "my.exe";
QStringList argument;
QProcess *myProcess = new QProcess(parent);
for ( int ix = 0; ix < 10; ix++ )
{
argument.clear();
argument << newargument;
myProcess->start(my.exe, argument);
}
Thank you very much.
Regards
Last edited by franco.amato; 2nd August 2011 at 17:54.
Franco Amato
That's right.
Yes, your QProcess object will live on.So the process is not destroyed once the external program has finished?QProcess inherits QObject, so the same rules as for most of the other Qt-classes apply also. Also think about creating a QProcess object as a member of your corresponding class. Then you don't have to take care about deleting.I have to destroy it manually?
Lykurg
Bookmarks