Does it is possible to connect more than one function into a Slot ?
Hi friends,
I wish know if instead above structure :
Code:
connect(_ui->buttonRecord , SIGNAL(clicked()) , this , SLOT(function1()));
Could I do something like that ?
Code:
connect(_ui->buttonRecord , SIGNAL(clicked()) , this , SLOT(function1() ;function2() ));
+++
Re: Does it is possible to connect more than one function into a Slot ?
No, you cannot do that.
What are you trying to do?
You'll get more help if you're more explicit about what you are trying to do.
If you want to connect more than one signal to the same slot, well can be done two ways that I know of: with the QSignalMapper and QBuggonGroup.
Re: Does it is possible to connect more than one function into a Slot ?
Did you try the obvious?
Code:
connect(_ui->buttonRecord , SIGNAL(clicked()) , this , SLOT(function1()));
connect(_ui->buttonRecord , SIGNAL(clicked()) , this , SLOT(function2()));
From QObject::connect():
Quote:
A signal can be connected to many slots and signals. Many signals can be connected to one slot.
If a signal is connected to several slots, the slots are activated in the same order as the order the connection was made, when the signal is emitted.
Re: Does it is possible to connect more than one function into a Slot ?
Oh, my!
I didn't know you could do that!
Re: Does it is possible to connect more than one function into a Slot ?
That was exactly what I need.
I tryed and worked fine.
Thanks a lot !