class С1{signals: void A(); void B();};class С2{public slots: void A(int param = 0); void B(int param = 0);};....connect(c1, SIGNAL(A()), c2, SLOT(A()));connect(c1, SIGNAL(B()), c2, SLOT(B()));
signalId = THIS_SIGNAL_ID;emit thisSignal();
Mapper::onSignal() { Emitter* e = qobject_cast<Emitter*> sender(); if (e) { int id = e->getSignalId(); // emit blabla(id); // c2->slot(id); // invoke...... etc }}
class C2: def connect2C1(self, c1): def gen_wrap(i): return lambda: self.slot(i) for i, signal in enumerate(('S1', 'S2', ... , 'Sn')): self.connect(c1, QtCore.SIGNAL(signal), gen_wrap(i))
void setStateByEvent(int event) { setState(m_States[event]);}
class С2{public slots: void A(int param = 0); void B(int param = 0); void Common(int);};void C2::Common(int why){switch(why) case valueA : A();break; case valueB : B();break;default : errorHandler(why);}