Signal and slots for Qt console application?

I wonder if signal and slots should be used with my own console object? Or are they used only with a graphical interface?

+3
source share
1 answer

You can use signals and slots in a console application. You can subclass QCoreApplicationor just use it as an event loop. In, main()create an object QCoreApplicationalong with any of your own objects using signals and slots, connect the signals, and then call .exec()onto the object QCoreApplication. Make sure you have a way to signal QCoreApplicationto exit.

+5
source

Source: https://habr.com/ru/post/1762201/


All Articles