[Qt-interest] Exiting before the main event loop

Arnold Krille arnold at arnoldarts.de
Mon Feb 23 12:57:23 CET 2009


Hi,

On Monday 23 February 2009 03:56:47 Pete Black wrote:
> Rohan McGovern wrote:
> > On Monday 23 February 2009, ext Pete Black wrote:
> >> Anyone know a good way of exiting an application before the main
> >> event loop has been entered? That is before app.exec() has been
> >> called, but withing the app object itself.
> > Just don't call app.exec() if you don't want to execute the
> > application.
> Yeah, was hoping there was a way, but I probably have to do that. Which
> means refactoring. Boxed myself in a bit by parsing some command line
> parameters from the app's constructor and I need to be able to quit from
> there.

Does that mean that you sub-classes QApplication "just" to parse command line 
args?
Why don't you access QApplication::arguments() from your main-function before 
you run app.exec()? And why can't you skip running app.exec() if your 
requisites aren't fulfilled. Or use "return" or "exit()" if needed?

I have to admit that I don't really understand your problem...

Have fun,

Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090223/b947bf1b/attachment.bin 


More information about the Qt-interest-old mailing list