I am developing an application using Qt. I don\'t know which slot corresponds to the event of \"the user clicking the \'X\'(close) button of the window frame\" i.e. this but
Well, I got it. One way is to override the QWidget::closeEvent(QCloseEvent *event) method in your class definition and add your code into that function. Example:
class foo : public QMainWindow
{
Q_OBJECT
private:
void closeEvent(QCloseEvent *bar);
// ...
};
void foo::closeEvent(QCloseEvent *bar)
{
// Do something
bar->accept();
}