I have a Qt Program run as full screen and top level, so when press power button, it does not turn off my computer.

I want to handle the power event on my QT program to close my program then call to shutdown. How to do this?

My Details: Fedora 14 KDE (Qt v4.7)