I have a spin control unit that changes the individual elements of the array. Instead of having separate functions of the receiver socket, I just wanted to indicate which control sent the message in the signal
You can do this with QSignalMapper - but is there a way to do this simply as shown below?
spin0 = new QDoubleSpinBox; connect(spin0,SIGNAL(valueChanged(double)),this,SLOT(handler(0,double)); spin1 = new QDoubleSpinBox; connect(spin1,SIGNAL(valueChanged(double)),this,SLOT(handler(1,double)); .... private slot: void handler(int element,double value);
source share