On Wednesday 18 February 2015 07:59:09 alexander golks wrote: > if you really want to log, why not just include the private header and do > the logging? we do it in our derived q(core)application::notify, when > catching exceptions during notify: > > #include <../../src/qtbase/src/corelib/kernel/qobject_p.h> > > //... > QMetaCallEvent* metaCallEvent=dynamic_cast<QMetaCallEvent*>(event); > if(metaCallEvent) > { > eventInfo+="\nmetacall event"; > eventInfo+="\nevent id: "+QString::number(metaCallEvent->id()); > eventInfo+="\nevent sender: "+getObjectInfo(metaCallEvent->sender()); > eventInfo+="\nevent: "+QString::number(metaCallEvent->signalId()); > }
Meta call events only happen for queued slot deliveries. For direct deliveries, there's no event, so notify() will not be called. For those, you need to use the hooks that QSignalSpy uses. One more thing: catching exceptions during notify() is too late. The exception may have caused a lot of damage inside Qt before it reached notify(). If you need to recover, you need to catch it earlier. If the exception reaches notify(), you should interrupt the event loop and exit the application -- for example, by rethrowing. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest