Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Track Emitted Signals in QT?

Is there any way to observe all signals which are emitted?

PS. Of course we can write slots for all signals, but that is not I want.

like image 691
metdos Avatar asked May 06 '10 10:05

metdos


1 Answers

What do you mean by observing? Do you need real time feedback on console, or is logging to file on program exit enough?

If you need real time feedback on console, you can check then implementation of QTest. There is a -vs command line switch (Qt doc) which enables all signals printout on console (or you can just run your QTest tests with -vs switch, if you need the signals info only in tests, not in actual application).

The other way is to use QSignalSpy class. It's not ideal however, because you need one spy per every signal, and you have to print the observed signals periodically (there are no notifications in QSignalSpy).

like image 90
chalup Avatar answered Oct 03 '22 22:10

chalup