[Interest] 5.4.2 Android Misery just one typo away

william.crocker at analog.com william.crocker at analog.com
Wed Jun 17 12:44:31 CEST 2015


>
> It's certainly one of the uglier gotchas people run into. Here is my humble attempt to document it more prominently:
>
> https://codereview.qt-project.org/#/c/114517/
>
> Anyhow, adding stuff to the documentation only helps so much, since people also have to read it :)
>
> In general, I consider deriving from Q*Application sort of an anti-pattern. You fall for it because, hey, you're writing 'application logic' , so the logic should go into something derived from *Application. Anyhow, unless you're really overriding one of the virtual methods there's just no reason to subclass. Just put your business logic in a separate, QObject based class. This way you avoid all of this mess.
>

I have a large app and it is convenient to override this:

     bool MyApplication::notify( QObject*, QEvent* ) { }

To make it easier to find the source of wayward throws.
I think that is the only reason.

Bill




More information about the Interest mailing list