6

I have been reading in the signals & slots documentation and it says that you can connect a signal to a signal and trigger the slot thats connected to the second signal in the chain. I cant find a way to do this in Qt designer, it only lets you connect a signal to a slot not a signal to a signal. Also i cant find it in the docs but if have a signal connected to a signal with the first signal carrying QString argument for example will the QString be propagated along the chain.

Thanks!

Exa
  • 4,020
  • 7
  • 43
  • 60
jonathan topf
  • 7,897
  • 17
  • 55
  • 85

2 Answers2

4

You can't do this in Qt Designer; you have to do it in code. And yes, you can propagate the QString parameter.

TonyK
  • 16,761
  • 4
  • 37
  • 72
  • There's nothing that'd speak against adding this in Qt Designer at a fundamental level, except that it's not expressable in the current `.ui` format, which uses `` elements. Any change to `` or similar wouldn't be backwards-compatible with older `uic`s. – Marc Mutz - mmutz Feb 15 '12 at 06:13
1

I don't think that's possible in the designer directly (it's not a very common thing to do). But you could do it in your custom code.

The parameters emitted with the original signal will be passed on the to slot after the relay.

Mat
  • 202,337
  • 40
  • 393
  • 406
  • 2
    "(it's not a very common thing to do)": Common enough, I would say. – TonyK Jun 07 '11 at 19:19
  • between widgets in the same "form"/group of forms like what you have in a designer view? – Mat Jun 07 '11 at 19:28
  • @Mat Think of a `changed()` signal on the form widget which relays different signals such as `currentIndexChanged(int)` etc. of the inner widgets. Designer can also connect to slots of the form widget, unfortunately not to signals... – Tilman Vogel Nov 29 '13 at 11:29