'Prompt on exit in PyQt application

Is there any way to promt user to exit the gui-program written in Python?

Something like "Are you sure you want to exit the program?"

I'm using PyQt.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source