[Qt-interest] Qthread takes a long time to stop

Berry Octave octave at octavious.servegame.org
Sun Jun 20 17:22:08 CEST 2010


On Sun, Jun 20, 2010 at 08:06:05AM -0400, william.crocker at analog.com wrote:
> 
> > 
> > Also, on close, while the main GUI thread is waiting for the helper 
> > threads.., I get the following message dialog on Linux:
> > 
> >  
> > 
> > Warning:
> > The Window “sampleapp” is not responding
> > Force Quit the application?
> > Yes-no
> >
> 
> 
> For me that is a known RedHat #4 bug.
> (or so I am told)
> 
> 
> >  
> > 
> > This appears very briefly..the application then closes before the user 
> > has a chance to click on either yes or no..( probably because the wait 
> > period is over..)
> > 
> >  
> > 
> > Any ideas why this could be happening and what I could do to prevent it?
> > 
> >  
> > 
> > Thanks,
> > 
> > Sarvesh
> > 
> >  
> > 

This is caused by your window manager in the case where your application is slow to answer
to the user's close request (if the user answer yes, the window manager will kill your app).

A nice way to handle it would be to close the window first and then try to stop your worker thread.
You can achieve that by calling a slot that will stop the worker thread from your closeEvent() method (this
will leave the event loop running and close your application window first).

Regards
Octave





More information about the Qt-interest-old mailing list