문제

I wrote a simple application to take pictures in c++ and am guessing I probably should do some cleanup whenever CTRL+C is pressed. I am using QTCreator to write the application along with MADDE, but am not really using any Qt hooks that I know of.

How can I handle CTRL+C in my application?

Thanks,

Walter

도움이 되었습니까?

해결책

It appears that maemo is based on linux. In linux C programs, you get an OS signal that you must write a handler for. You can go that route, but Qt seems to offer a signal that it fires when a program is ready to quit.. http://doc.qt.nokia.com/stable/qcoreapplication.html#aboutToQuit

Here is some more info about how to go about catching the OS signal in question, and then acting on it. Note that if you catch the OS signal, you probably won't get the "aboutToQuit" signal automatically anymore.

http://doc.qt.nokia.com/4.7/unix-signals.html

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top