Results 1 to 5 of 5

Thread: multiple qprocess arguments

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2015
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default multiple qprocess arguments

    I am invoking a linux system process using QProcess. The process works, but when I supply more arguments than the three prescribed arguments it gives an error.

    sox.start("sox", infile.wav -c 1 outfile.wav remix 0 1);

    How can I make it accept my last argument "remix 0 1"?
    Qt Code:
    1. #include <QtGui>
    2. #include <QApplication>
    3.  
    4. int main(int argc, char* argv[])
    5. {
    6. QApplication app(argc, argv);
    7.  
    8. QProcess sox; //instantiate the process****
    9. QStringList args1; //declare arguments
    10. args1 << "infile.wav"; //collect arguments to be envoked with qprocess
    11. args1 << "-c 1"; //collect arguments to be envoked with qprocess
    12. args1 << "outfile.wav"; //collect arguments to be envoked with qprocess
    13. //args1 << "remix 0 1"; //collect arguments to be envoked with qprocess
    14.  
    15. sox.start("sox", args1); //pass qprocess and arguments to start method
    16. QByteArray output; //understood by QString
    17. while(sox.waitForReadyRead())
    18. output += sox.readAll();
    19. qDebug() << "sox" << args1;
    20. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by anda_skoa; 28th January 2015 at 09:22. Reason: missing [code] tags

Similar Threads

  1. Replies: 7
    Last Post: 15th November 2010, 09:00
  2. QProcess Arguments
    By doggrant in forum Qt Programming
    Replies: 0
    Last Post: 4th November 2010, 16:45
  3. QProcess error Using Arguments Qt 4.5
    By xanders in forum Qt Programming
    Replies: 6
    Last Post: 15th May 2009, 15:56
  4. Replies: 3
    Last Post: 25th February 2009, 16:55
  5. QProcess and none-string arguments
    By Raistlin in forum Qt Programming
    Replies: 8
    Last Post: 12th March 2008, 15:28

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.