close() and deleteLater()
Hi,
I have created an application which has several UI forms. When the user clicks on the shutdown button, the ui form for shutdown appears where i call a function to save the last state of the application to a database. On completion I emit a signal. This signal is connected to a slot where I have written this->close();
When I run my application I see using qDebug() << messages that the slot where this->close(); is written is executed but it does not close the UI application.
I wrote this->deleteLater(); instead and it successfully closed the application.
Is this a correct way to do it? Any help is appreciated.
Giselle
Re: close() and deleteLater()
Is any of the other windows still open when you call close()?
In any case there is nothing wrong with deleting the window at program end.
Cheers,
_
Re: close() and deleteLater()
Hi,
Thank you for your reply.
There is no other window open. If I add a pushbutton and implement this->close(); in the onclicked slot of pushbutton the window closes.
But if I were to simply call a function and that saves the application last state and at the end emits a signal stating all states saved and if i connect this signal to a slot which implements this->close(); it does not close. Only this->deleteLater(); works in this case. Anycase if deleting the window at the end of the program is Ok then I will use this->deleteLater();
Thank you