Results 1 to 5 of 5

Thread: Help with QProcess!!

  1. #1
    Join Date
    Jul 2008
    Posts
    48
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Help with QProcess!!

    Hi everyone,

    I've been working with this problem a while now :\.

    Somehow I'm trying to do this that I would in a command line like this: "suxwigb < hseis.out clip=1.0"

    In the program the code I use to achieve this looks like this:

    Qt Code:
    1. void MainWindow::view()
    2. {
    3. textEdit_2->clear();
    4. // Setting the Environment for Seismic Unix
    5. QStringList env = QProcess::systemEnvironment();
    6. env << "CWPROOT=" + environment;
    7. suxwigb.setEnvironment(env);
    8.  
    9.  
    10. args << "clip=1.0"
    11. ;
    12.  
    13. suxwigb.setStandardInputFile("hseis.out");
    14. suxwigb.setWorkingDirectory( QDir::current().currentPath() );
    15. suxwigb.start("suxwigb", args);
    16. }
    To copy to clipboard, switch view to plain text mode 

    The funny thing is that.. this works on linux works on Linux and and inside Contents of the MacOS application Prog.app/Contents/MacOS/Prog

    but when I try calling that action when I open the program through "open Prog.app", it will not work !!!

    and I get this error:

    xwigb: subcalls.c: efopen: fopen failed /dev/tty, w
    suxwigb process crashed

    Any ideas what's happening???

    Thanks in advance,

    Ed.

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Help with QProcess!!

    looks like another instance of process suxwigb is running and using hseis.out..causing fopen to not work and crashing ur app..

  3. #3
    Join Date
    Jul 2008
    Posts
    48
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Help with QProcess!!

    Seems unlikely, I only call it once in the program, but do you mean the error I'm seeing is because the file hseis.out maybe in use by another program?
    Last edited by afflictedd2; 28th March 2009 at 20:04.

  4. #4
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Help with QProcess!!

    fopen cant open it, so most probably file's in use i guess

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Help with QProcess!!

    I'd say the problem is in using a relative path to the input file. The working directory is probably different when starting the application using open and using console and the file can't be found.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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 exitStatus()
    By user_mail07 in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2008, 20:51
  3. QProcess and Pipes
    By KaptainKarl in forum Qt Programming
    Replies: 1
    Last Post: 9th April 2007, 23:11
  4. QProcess extremely slow on Windows?
    By Pepe in forum Qt Programming
    Replies: 2
    Last Post: 26th March 2007, 00:25
  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.