Results 1 to 20 of 20

Thread: QThread with Python Popen freezing on sizable external program

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Qt products
    Qt5
    Platforms
    MacOS X
    Thanks
    13
    Thanked 153 Times in 150 Posts

    Default Re: QThread with Python Popen freezing on sizable external program

    I'm not entirely sure I understand what you're doing, but a couple of observations:

    - QProcess:waitForFinished() will block for 30,000 milliseconds (30 seconds). If your process ends before 30 seconds is up, it will return. It will also return after 30 seconds expires even if your QProcess is still running. Just used the QProcess signals to get state changes and/or finished notification, etc.

    - Not sure what your while loop is trying to accomplish. You will get the process exit code and exit status in the finished signal. Use that to determine whether your process ran successfully.

    - Your progress bar updates are likely not reflecting the completion status since you are arbitrarily updating your progress every .5 seconds. How many seconds will the process run to completion, does it vary?

    - You can read output of your QProcess, so if it's outputing any information while running, you can consume that output to get a better completion status if your process normally displays this. I have used QProcess like this in the past where i read the stdout and stderr of the QProcess to determine progress, etc.

    Good luck.
    Last edited by jefftee; 8th March 2015 at 03:45.

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

    jkrienert (8th March 2015)

Similar Threads

  1. PyQt4: Create simple GUI for python program
    By Norchina in forum Newbie
    Replies: 0
    Last Post: 11th June 2010, 15:50
  2. Replies: 1
    Last Post: 30th April 2010, 14:25
  3. running external console program by gui program
    By alireza.mixedreality in forum Qt Programming
    Replies: 4
    Last Post: 24th April 2010, 19:05
  4. Replies: 1
    Last Post: 16th February 2010, 00:20
  5. Replies: 7
    Last Post: 19th January 2008, 16:29

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.