I am goint to develop some console application, and after that probably add GUI to its. I am begginer with QT
and I wonder if I should use signal and slots with my own console object? Or if them is used only with GUI?
views:
54answers:
2
A:
Are you going to be updating the console screen when some event/signal happens?
juxstapose
2010-08-30 01:19:24
I don't really know, are there any happends in console app? I think i could handle it without it. I also want to use all power of QT.
John X
2010-08-30 01:22:59
Don't get confused between Qt signals/slots and events. Signals and slots are just Qt's clever way of handling inter-object communication. They can and should be used wherever applicable.
teukkam
2010-08-30 11:11:04
+3
A:
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.
Arnold Spence
2010-08-30 01:31:06