QException
#include <QException>
Public Functions
virtual | ~QException() |
virtual QException * | clone() const |
virtual void | raise() const |
Detailed Description
QException类为可以跨线程传输的异常提供了一个基类。
QtCurrent支持跨线程边界抛出和捕获异常,前提是该异常继承自QException并实现两个辅助函数:
class MyException : public QException { public: void raise() const { throw *this; } MyException *clone() const { return new MyException(*this); } };
QException子类必须由值引发并通过引用捕获:
try { QtConcurrent::blockingMap(list, throwFunction); // throwFunction throws MyException } catch (MyException &e) { // handle exception }
#######################
标签:const,raise,MyException,throwFunction,virtual,QException From: https://www.cnblogs.com/herd/p/17494502.html