PDA

View Full Version : QProcess question



lni
19th July 2007, 18:34
Hi,

I am trying to submit a job to a different node/machine using QProcess. The command is like:



qsub -r y -b y -cwd -sync y -notify -l hostkey="b019[0-8][0-9]" -t 1-1 "convert_data file1 file2"


In the above command, qsub is to submit a job in a node defined by a range nodes "b019[0-8][0-9]", and the real command is "convert_data file1 file2"

How can I use QProcess in this case?

Thanks

marcel
19th July 2007, 18:46
Try with QProcess::execute. I think you have to add quotes to arguments that contain any spaces, on Windows.

You also should connect the QProcess::finished signal to a slot in one of your classes.

Regards

lni
19th July 2007, 19:04
Try with QProcess::execute. I think you have to add quotes to arguments that contain any spaces, on Windows.

You also should connect the QProcess::finished signal to a slot in one of your classes.

Regards

Thanks.

I am using start() method instead of execute, otherwise I won't be able to connect the signals/slots.



void start( const QString& program, const QStringList & arguments, OpenMode mode = ReadWrite )
void start ( const QString & program, OpenMode mode = ReadWrite )


The problem is what is the "program" and what is the "arguments"? I try both methods, neither works, because the actual command has its own arguments.

marcel
19th July 2007, 19:06
Well, the program will be "qsub" and the rest stands for the arguments.
But qsub should be in the path, otherwise it won't work.
If you can't add it to the path, then give the full path, like "/usr/bin/qsub"

Regards.