开发者

Signal and slots for Qt console application?

I wonder if I should use signal and slot开发者_开发百科s with my own console object? Or are they only used with a GUI?


You can use signals and slots in a console application. You can subclass QCoreApplication or just use one as an event loop. In main(), create a QCoreApplication object along with any of your own objects that use signals and slots, connect the signals and then call .exec() on the QCoreApplication object. Make sure you have some way to signal the QCoreApplication to quit.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜