Let's say we have the follogin UI:
+--------------------------+
|W1 +--------------+ |
| |W2 | |
| | +----------+ | |
| | |W3 | | |
| | +----------+ | |
| | | |
| +--------------+ |
+--------------------------+
W3 is interested in a certain signal emited in W1 (or a level below, i.e. qApp).
The idea is to develop W3 independently. But somebody has to do the signal/slot connection.
What would be a good practice/recommended way of connecting the signal emited in W1 into slot in W3 if we want W3 not to know about any other widget, and we don't want W1 to know about W3 either?
Solution 1:
Connect signal in W1 with signal in W2 (signal to signal technique) and therefore connect signal in W2 to slot in W3.
Solution 2:
Generate a qApp signal and connect it in W2 with slot in W3.
Solution 3:
Generate a qApp signal and have W3 itself connect to it using its own slot.
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…