Qt one signal to multi slot. And there are 2 connection type slots. Will there be any problems?

49 Views Asked by At

Different classes and threads try to send one signal to two or more slots. There are two types of slots: queue and direct. Is it okay to use both DirectConnection and QueuedConnection for slots? ex)

B.cpp
A* a = A::sharedInstance();
connect(a, &A::signal, this,&B::slots, Qt::DirectConnection);

C.cpp
A* a = A::sharedInstance();
connect(a, &A::signal, this,&C::slots, Qt::DirectConnection);

D.cpp
A* a = A::sharedInstance();
connect(a, &A::signal, this,&D::slots);

The signal was transmitted only through QueuedConnection slots.

0

There are 0 best solutions below