开发者

Qt - Maemo application - how to handle CTRL+C?

开发者 https://www.devze.com 2023-02-05 09:34 出处:网络
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

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 applic开发者_StackOverflow中文版ation?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消