Results 1 to 4 of 4

Thread: QProcess question

  1. #1
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QProcess question

    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

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QProcess question

    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

  3. #3
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QProcess question

    Quote Originally Posted by marcel View Post
    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.

    Qt Code:
    1. void start( const QString& program, const QStringList & arguments, OpenMode mode = ReadWrite )
    2. void start ( const QString & program, OpenMode mode = ReadWrite )
    To copy to clipboard, switch view to plain text mode 

    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.

  4. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QProcess question

    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.

Similar Threads

  1. Question about QProcess
    By lni in forum Qt Programming
    Replies: 5
    Last Post: 27th April 2007, 23:08
  2. QProcess and Pipes
    By KaptainKarl in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2007, 23:11
  3. Replies: 2
    Last Post: 30th March 2007, 08:10
  4. QProcess Question
    By Vash5556 in forum Qt Programming
    Replies: 1
    Last Post: 26th February 2007, 16:24
  5. problem with qprocess
    By deekayt in forum Qt Programming
    Replies: 2
    Last Post: 13th June 2006, 13:30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.