[Qt-interest] Waiting for QProcess to finish without freezing GUI
qzvjtml02 at sneakemail.com
qzvjtml02 at sneakemail.com
Thu Jul 9 23:34:34 CEST 2009
Bob,
I hadn't thought of looking at it, thanks! You don't think
QThread::wait() will have the same effect as QProcess::waitForFinish()
(i.e. freezing the GUI)? Also, I read that QThread::terminate() is
"dangerous"– do you think it'd be safe to call it while the thread has
a QProcess running?
Kyle Fazzari
On Jul 9, 2009, at 2:09 PM, Bob Hood bhood2-at-comcast.net |Qt-
interest| wrote:
> 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
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090709/93f09104/attachment.html
More information about the Qt-interest-old
mailing list