[Qt-interest] try-catch in QApplication::notify() reimplementation

Andreas Pakulat apaku at gmx.de
Thu Aug 5 16:09:47 CEST 2010


On 05.08.10 15:18:03, Karl Krach wrote:
> 
> Hello,
> 
> I have a short question. I'm just wondering, how "You must reimplement
> QApplication::notify() and catch all exceptions there." could work.
> 
> I ve implemented the following, and many mailinglist posts recommend the same,
> but it's not working:
> 
> class MyApplication : public QApplication
> {
> public:
>     MyApplication(int argc, char** argv) : QApplication(argc, argv) {}
>     virtual ~MyApplication() {}
>     virtual bool nofity(QObject *rec, QEvent *ev)

You have a typo here, its 'notify' not 'nofity'.

> Maybe it's a problem, that QApplication::notify() is not virtual - but
> according the git repro it was since 4.5 never virtual... :s

It was virtual since Qt4.0 and will be until at least 5.0.

Andreas

-- 
You are going to have a new love affair.



More information about the Qt-interest-old mailing list