[Qt-interest] Exiting before the main event loop

Scott Aron Bloom Scott.Bloom at sabgroup.com
Tue Feb 24 00:02:22 CET 2009


> Arnold Krille wrote:
> > Hi,
> >
> > no need to CC me, I read the list (especially the topics I responded
to).
> 
> Not everybody does :).
> 
> > 2) Create a "bool MyQApplication::shouldRun()" and replace the
app.exec()-
> line
> > in your main with "if ( app.shouldRun() ) app.exec()".
> 
> I like this one. Thank you for that.
> 
> Pete

Another possible solution...

MyAppl::MyAppl(....)
{
	If ( errorConditionExisted )
		throw ....
}

Its really bad form to call "exit" directly.. but its quite common to
throw an exception 

Scott




More information about the Qt-interest-old mailing list