[Qt-interest] Returning arbitrary value?with?QApplication::exit ()

Pascal Patry iscy at invalidip.com
Fri Jun 26 23:37:04 CEST 2009


On Friday 26 June 2009 16:27:35 Andreas Pakulat wrote:
> On 26.06.09 16:13:10, Pascal Patry wrote:
> > On Friday 26 June 2009 15:43:23 Andreas Pakulat wrote:
> > > On 26.06.09 15:22:45, Pascal Patry wrote:
> > > > On Friday 26 June 2009 15:09:59 Andreas Pakulat wrote:
> > > > > I don't think its safe to re-create QApplication, AFAIK this can
> > > > > lead to subtle hard-to-track bugs later on.
> > > > >
> > > > > Andreas
> > > >
> > > > I don't want to say that this kind of design is wrong, neither that
> > > > you are, but I think that developing a software thinking that a
> > > > particular class cannot be instantiated again once destroyed is a
> > > > mistake.
> > >
> > > Well, we're not talking about just any class. QApplication is certainly
> > > special in this sense. It does a lot of setup stuff to actually make
> > > the whole Qt "magic" work. Some of these things might not easily be
> > > reversible and hence re-doing them might cause unknown or undefined
> > > behaviour.
> >
> > Whether it is caused by Qt or not, bugs should be opened in respective
> > trackers if this is the case.
>
> Just to be closed as "can't fix" or "wont fix"? Sorry, fail to see the
> reason for that. I know in theory there should be no reason why a
> QApplication might not be recreated,

In theory, having to recreate a QApplication probably shows that your design 
is weak, but it's not a reason to leave a known bug in your code. Most of the 
times, the maintainers don't know about the problem because too many people 
adopted the attitude of finding workarounds instead of reporting the problem 
upstream.

Also, C++ is not a language that limits the number of solutions available.

So yes, even if they close it as 'wontfix', it's a good thing to report bugs.

> however in reality things are often
> pretty different. If I am really right about this, I'm still not 100%
> sure for Qt4 (I am pretty sure in the case of Qt3)
>
> Andreas




More information about the Qt-interest-old mailing list