ahmadka
12th June 2010, 00:21
Hey guys .. My question here is regarding signals and slots ..
For example, say you have like 10 buttons, all of which pass a number into a factorial function .. the only difference is that they all pass a different number into this one factorial function ... suppose the function is:
int factorial (int a);
so for example, button1 evaluates this function where a =1,
so for example, button2 evaluates this function where a =2,
so for example, button3 evaluates this function where a =3,
and so on ..
In such a case, is there any way to connect these multiple 'clicked' signals from each individual button to the same factorial slot, but just pass in a different value for a .. ? The alternative is to make a connect statement for each individual button, which seems rather inefficient considering they all do more or less the same thing ..
For example, say you have like 10 buttons, all of which pass a number into a factorial function .. the only difference is that they all pass a different number into this one factorial function ... suppose the function is:
int factorial (int a);
so for example, button1 evaluates this function where a =1,
so for example, button2 evaluates this function where a =2,
so for example, button3 evaluates this function where a =3,
and so on ..
In such a case, is there any way to connect these multiple 'clicked' signals from each individual button to the same factorial slot, but just pass in a different value for a .. ? The alternative is to make a connect statement for each individual button, which seems rather inefficient considering they all do more or less the same thing ..