Results 1 to 3 of 3

Thread: Qt3 qprocess, executable exited?

  1. #1
    Join Date
    Dec 2007
    Posts
    129
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Qt3 qprocess, executable exited?

    hi,

    im using qt3 ryt now, im trying to call an executable file using qprocess

    the executable is a movie player but the movie is on the other computers database so it uses socket..

    Qt Code:
    1. QProcess *proc= new QProcess(executablepath);
    2. proc->addargument("-i");
    3. ..//and many more addarguments cause it is required by the executable
    4. proc->start();
    To copy to clipboard, switch view to plain text mode 
    the executable shows but closes immediately after starting..
    if i run the application with the arguments manually, it shows and does not close immediately..

    Now what could be the problem?

    the executable?

    the arguments? cause some of the arguments are path like bin/directory/ i did not change the / to // or to \

    my code?
    if i run the executable manually it goes like this:

    ./myplayer -i 100.000.0.1 -p 4000 -k ./bin/directory/ -t 5

    in my codes it goes like this:
    Qt Code:
    1. QProcess *proc = new QProcess("./myplayer"); //i just put the ./myplayer to fast understanding
    2. proc->addargument("-i");//ip
    3. proc->addargument("100.000.0.1");
    4. proc->addargument("-p");//port
    5. proc->addargument("4000");
    6. proc->addargument("-k");//directory
    7. proc->addargument("./bin/directory/");
    8. proc->addargument("-t");//socket timeout
    9. proc->addargument("5");
    10. proc->start();
    To copy to clipboard, switch view to plain text mode 
    how to solve this?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Qt3 qprocess, executable exited?

    Where is "myplayer"? What is current working directory?

    PS. Use QDir::current() or currentPath() to check CWD.
    J-P Nurmi

  3. #3
    Join Date
    Dec 2007
    Posts
    129
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt3 qprocess, executable exited?

    the answer is.. the error is on the executable..

    i found now the error the application is requiring a .ttf font config it should be place beside the application.. i overlook it..

    thanks anyways..

Similar Threads

  1. Detect First QProcess finished in a group and kill other
    By Davidaino in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2008, 12:53
  2. QProcess and Pipes
    By KaptainKarl in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2007, 23:11
  3. Problem closing a QMainWindow in Qt4.2
    By ian in forum Qt Programming
    Replies: 11
    Last Post: 17th October 2006, 00:49
  4. QProcess / system call not working under linux. Why?
    By johnny_sparx in forum Qt Programming
    Replies: 12
    Last Post: 11th March 2006, 00:32

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.