#include "QCloseEvent"#include "QWidget"void Settings::closeEvent(QCloseEvent *event){ if (maybeSave()) { writeSettings(); event->accept(); } else { event->ignore(); }}
protected: void closeEvent(QCloseEvent *event);