Qt: How do I handle the event of the user pressing the 'X' (close) button?

前端 未结 4 1089
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-02 06:50

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

4条回答
  •  独厮守ぢ
    2020-12-02 07:02

    You can attach a SLOT to the

    void aboutToQuit();
    

    signal of your QApplication. This signal should be raised just before app closes.

提交回复
热议问题