Dear all,

I would kite to know know can I notify errors from objects of classes derived from QObjects. Searching in the net, many times I've seen that if is suggested to overload the QCoreApplication::notify() member function (http://stackoverflow.com/questions/4...error-handling), but i don't like it much, I would prefer to notify errors by emiting signals. For example:

Qt Code:
  1. class Foo : public QObject
  2. {
  3. Q_OBJECT
  4.  
  5. Q_SIGNALS:
  6. void error(QString string);
  7.  
  8. Q_SLOTS:
  9. void do_something()
  10. {
  11. try
  12. {
  13. a = ...;
  14. <do something>
  15. }
  16. catch (std::exception &e)
  17. {
  18. Q_EMIt error(QString::fromStdString(e.what()));
  19. }
  20. }
To copy to clipboard, switch view to plain text mode 

Does anyone uses this policy? How do you use it? One signal per exception type? How do you notify errors from Qt objects?

Thanks and Best Regards,
Joaquim Duran