Results 1 to 6 of 6

Thread: QProcess problem (Main program hangs)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QProcess problem (Main program hangs)

    Quote Originally Posted by jpn View Post
    Starts the program program with the arguments arguments in a new process, waits for it to finish, and then returns the exit code of the process.
    Yes, but this doesn't explain the hanging. I wonder whether the application, doesn't look like this:
    Qt Code:
    1. ...
    2. QProcess::execute( ... );
    3. ...
    4. p.waitForFinished( ... );
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to jacek for this useful post:

    sincnarf (11th October 2007)

  3. #2
    Join Date
    Apr 2007
    Posts
    117
    Thanks
    84
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QProcess problem (Main program hangs)

    I didn't use waitForFinished because this means I have to close eog first before I can get back to my mainwindow. What I was trying to do was to both simultaneously run my mainwindow and the process eog.

    Does this mean I can't run my mainwindow along with the QProcess that calls eog?
    Image Analysis Development Framework Using Qt (IADFUQ)

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

    Default Re: QProcess problem (Main program hangs)

    You can, you just can't use the static method approach. You need to create a regular QProcess object (on heap), call start() on it and voila. You should be able to continue using your application while the viewer executes. If your application still hangs, it means the process has nothing to do with it - try commenting out those lines related to QProcess and see if the application hangs or not.

  5. The following user says thank you to wysota for this useful post:

    sincnarf (13th October 2007)

Similar Threads

  1. Problem with qprocess
    By resal in forum Qt Programming
    Replies: 8
    Last Post: 29th August 2007, 22:13
  2. New to QT, problem displaying main window...
    By McCall in forum Qt Programming
    Replies: 4
    Last Post: 15th June 2007, 14:27
  3. QProcess hangs
    By Skizmo in forum Qt Programming
    Replies: 4
    Last Post: 8th March 2007, 10:27
  4. QT MySQL
    By sabeeshcs in forum Newbie
    Replies: 6
    Last Post: 12th January 2007, 04:19
  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
  •  
Qt is a trademark of The Qt Company.