C++ (Qt)void QObject::destroyed ( QObject * obj = 0 ) [signal]
C++ (Qt)bool QApplication::notify ( QObject * receiver, QEvent * e ) [virtual]
C++ (Qt)class QUApplication : public QApplication{Q_OBJECT ...Q_SIGNALS: void aboutToClose( QWidget*, bool& ); public: bool notify( QObject* o, QEvent* e ) { QWidget* w = o->isWidgetType() ? qobject_cast< QWidget* >( o ) : 0; if( w ) { switch( e->type() ) { case QEvent::Close: if( w->isVisible() && !w->parentWidget() && !w->windowFlags().testFlag( Qt::Dialog ) && w->testAttribute( Qt::WA_QuitOnClose ) ) { bool do_close = true; emit aboutToClose( w, do_close ); if( !do_close ) { e->ignore(); return false; } } break; default: break; } } return QApplication::notify( o, e ); }};
C++ (Qt)bool do_close = true;emit aboutToClose( do_close );if( !do_close )