Filter Qt signals as one event filter

With Qt, I can filter out all the events QEventthat my application receives or produces with:

qApp.installEventFilter(my_filter_object)

Is there a way to filter Qt signals ( signals and slots ) in the same way can I filter QEventevents?

With the QtCore.QStateMachine.SignalEventextension QEventand StateMachineSignal QEvent.Type, there everything seems to be in place, but my event filter may not seem to be one of them.

IOW, is there a way to get the name (index) of the signal, the object emitting the signal, and the arguments passed for each signal of each QObjectin my application without explicitly connecting to it?

Thanks!

+4
source share
2 answers

. API QSignalSpy, . - TestLib Framework, (-vs), . , .

, QMetaObject, QObject . , , ( , ).

- , . , , -. QEvent.MetaCall.

QMetaCallEvent, Qt, PyQt. id(), sender(), signalId() args(). PyQt , , - QEvent, .

QMetaCallEvent, - reset .

+4

, . , eventloop. ( ) - , , , , , .

+1

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


All Articles