[Qt-interest] Waiting for QProcess to finish without freezing GUI

Bob Hood bhood2 at comcast.net
Thu Jul 9 23:09:35 CEST 2009


How about just running your console process in a QThread?


qzvjtml02 at sneakemail.com wrote:
> Hello.
>
> 	I am using QProcess to wrap a GUI around a console application.  
> Unfortunately, the console application uses the internet, and logs in  
> on startup. This means that the console application could take FOREVER  
> to finish, depending on the internet connection. What I'd like to do  
> is wrap QProcess calls in a modal QProgressDialog. I programmed this  
> up, but when I call the QProcess stuff I use QProcess::waitForFinish()  
> so that my application doesn't try to continue without the console  
> application being started. What this means is that the QProgressDialog  
> comes up fine, but then my GUI freezes because I called  
> QProcess::waitForFinish(). I know there's a better way to do this...  
> does anyone have any advice? Ideally I'd display a "logging in"  
> QProgressDialog while the console application runs. If the user clicks  
> the "cancel" button on the QProgressDialog, I kill the QProcess. Is  
> this possible without the GUI freezing?
>
> 	Thank you for your help!
>
> 		Kyle Fazzari
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>

-- 

Render me gone,                       |||
Bob                                 ^(===)^
---------------------------------oOO--(_)--OOo---------------------------------
                      "If ya can't beat 'em, tariff 'em."
                                   - /Harley-Davidson Motor Company/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090709/ff4b0f7c/attachment.html 


More information about the Qt-interest-old mailing list