Can I send a signal with several parameters to a slot with only one parameter?
Hi dudes!
Can I send a signal with several parameters to a slot with only one parameter?
Is this possible:
connect(d, SIGNAL(valueThreeIntegersChanged(int,int,int)), this, SLOT(UpdateSecondInteger(int)));
How can I choose which parameter I send? (Let's say I'd like to send the 2nd param to this slot)
Thanks for help.
Re: Can I send a signal with several parameters to a slot with only one parameter?
Quote:
Originally Posted by
ricardo
Hi dudes!
Hi
Quote:
Can I send a signal with several parameters to a slot with only one parameter?
Is this possible:
connect(d, SIGNAL(valueThreeIntegersChanged(int,int,int)), this, SLOT(UpdateSecondInteger(int)));
Yes, it's possible.
Quote:
How can I choose which parameter I send? (Let's say I'd like to send the 2nd param to this slot)
You can't. It will be always the first one. The leftover parameters will be ignored. You can implement an intermediate slot that will call UpdateSecondInteger() with desired parameters, though.
Re: Can I send a signal with several parameters to a slot with only one parameter?
Quote:
Originally Posted by
jpn
You can implement an intermediate slot that will call UpdateSecondInteger() with desired parameters, though.
Thanks for reply. How can I do it?
Re: Can I send a signal with several parameters to a slot with only one parameter?
I meant something like this:
Code:
connect(d, SIGNAL(valueThreeIntegersChanged(int,int,int)), this, SLOT(intermediateSlot(int,int,int)));
void Foo::intermediateSlot(int a, int b, int c)
{
Q_UNUSED(a);
Q_UNUSED(c);
UpdateSecondInteger(b);
}