0

I want to connect signal_A(C) from itemA to function_B(currentIndex,C) from itemB.

How do I connect them? When its signal_A(C) -> function_B(C) it will be: itemA.signal_A.connect(itemB.function_B);

But I am not sure how to link them when there is an extra argument on the slot. Something like this: item_A.signal_A.connect(item_B.function_B(currentIndex, C));

Louis Langholtz
  • 2,913
  • 3
  • 17
  • 40
laurapons
  • 971
  • 13
  • 32

1 Answers1

2

You can create a wrapper function at a place that has access to the currentIndex

function wrapFunctionB(C) {
    return function_B(currentIndex, C)
}

and then connect to this function:

item_A.signal_A.connect(where.ever.wrapFunctionB)

If the place where you connect has access to all parameters, you can also connect it to an anonymous function:

item_A.signal_A.connect(function(C) { function_B(from.where.ever.currentItem, C) })