> José Arcángel Salazar Delgado wrote:
> > hi,
> >
> >
> > I 'm trying to catch all the exceptions to log every problem encounter
> > in a program, but i cannot catch exceptions from the QApplication.exec()
> > method.
> >
> >
> > for example:
> >
> >
> > try{
> > ....
> > QApplication.exec();
> > }
> > catch (Throwable t) {
> > LOGGER.logp(Level.SEVERE, "SilmGui", "main(String[])", "Excepción", t);
> > }
> >
> >
> > is not working if some exception if throw from some slot function.
> >
> >
> > Is there any way to catch exceptions from QApplication in order to log
> > these exceptions?
>
> Hi Jose,
>
> There is no way of catching all exceptions that are being fired from
> usercode into Qt. Primary reason for this is that if an exception
> happens in Java and we return to C++ JNI tends to crash unless we clean
> up all java exceptions.
>
> Exceptions that are caught when calling slots are another matter and
> could potentially be forwarded, but this is not done today. The code to
> look at is at least emit_helper() in
> com/trolltech/qt/internal/QSignalEmitterInternal.java. Just search for
> "Exception caught after invoking slot"
>
ok, let me check if I can do the work.

Also, what about using java.util.logging to log Qt exception instead of 
printStackTrace()? or do you like more to throw and uncheked exception?

It will be useful to have a log for the internal exceptions and is alrededy 
include with java (no more dependencies to add).
> -
> Gunnar
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to