Yes you can connect signal to another signal (link to documentation)
Also the objects "live" in the same time, so you can directly connect signals and slot from outside of all of them (from the scope that include them)
A *prtA = new A;
B *ptrB = new B;
C *ptrC = new C;
connect(ptrC, SIGNAL(signal_fromC()), ptrA, SLOT(slot_fromA()) );
//if you are in main or outside other QObject derived class you just need to use the static connect, like this:
//QObject::connect(ptrC, SIGNAL(signal_fromC()), ptrA, SLOT(slot_fromA()) );
A *prtA = new A;
B *ptrB = new B;
C *ptrC = new C;
connect(ptrC, SIGNAL(signal_fromC()), ptrA, SLOT(slot_fromA()) );
//if you are in main or outside other QObject derived class you just need to use the static connect, like this:
//QObject::connect(ptrC, SIGNAL(signal_fromC()), ptrA, SLOT(slot_fromA()) );
To copy to clipboard, switch view to plain text mode
Bookmarks