C++ (Qt)/* These wrap try/catch so we can switch off exceptions later. Beware - do not use more than one QT_CATCH per QT_TRY, and do not use the exception instance in the catch block. If you can't live with those constraints, don't use these macros. Use the QT_NO_EXCEPTIONS macro to protect your code instead.*/ #ifdef QT_BOOTSTRAPPED# define QT_NO_EXCEPTIONS#endif#if !defined(QT_NO_EXCEPTIONS) && defined(Q_CC_GNU) && !defined (__EXCEPTIONS) && !defined(Q_MOC_RUN)# define QT_NO_EXCEPTIONS#endif #ifdef QT_NO_EXCEPTIONS# define QT_TRY if (true)# define QT_CATCH(A) else# define QT_THROW(A) qt_noop()# define QT_RETHROW qt_noop()#else# define QT_TRY try# define QT_CATCH(A) catch (A)# define QT_THROW(A) throw A# define QT_RETHROW throw#endif
C++ (Qt)QWidget::QWidget(QWidget *parent, Qt::WindowFlags f) : QObject(*new QWidgetPrivate, 0), QPaintDevice(){ QT_TRY { d_func()->init(parent, f); } QT_CATCH(...) { QWidgetExceptionCleaner::cleanup(this, d_func()); QT_RETHROW; }}