this is a simplified version of my problem: I have 2 sliders that send information to another class/object:

Qt Code:
  1. // .h file
  2. QSlider *zXag[2];
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. // .cpp file
  2.  
  3. zXag[0] = new QSlider(Qt::Vertical);
  4. zXag[1] = new QSlider(Qt::Vertical);
To copy to clipboard, switch view to plain text mode 

My problem is with the connect. I want to do something like this:

Qt Code:
  1. connect(zXag[0], SIGNAL(valueChanged(int)), coin3dWidget, SLOT(setVertExag_0(int)));
  2. connect(zXag[1], SIGNAL(valueChanged(int)), coin3dWidget, SLOT(setVertExag_1(int)));
To copy to clipboard, switch view to plain text mode 

which works fine. But instead of 2 SLOT functions defined like above, I want something like:

setVertExag[0](int)
setVertExag[1](int)

In other words, just as I've an array of 2 slider objects, I'd like an array of 2 slot functions. I know you cannot make arrays of functions in C++, but hopefully you can at least see what I'm trying to do here and can suggest a solution. Below is the actual function that generates my sliders (and connects), in case this helps explain:

Qt Code:
  1. //function call
  2. for(int a=0; a<Total_Num_Sliders; a++)
  3. {
  4. mkZXag(a);
  5. }
  6.  
  7. //function
  8. void Window::mkZXag(int compNUM)
  9. {
  10.  
  11. zXag[compNUM] = new QSlider(Qt::Vertical);
  12. zXag[compNUM]->setSingleStep(1);
  13. zXag[compNUM]->setTickInterval(10);
  14. zXag[compNUM]->setTickPosition(QSlider::TicksRight);
  15.  
  16. connect(zXag[compNUM], SIGNAL(valueChanged(int)), coinWidget, SLOT(setVExag/*???*/(int)));
  17.  
  18. }
To copy to clipboard, switch view to plain text mode