You'll want to add this to your *.h file (replace MyClass with your class name):
Qt Code:
  1. MyClass {
  2. public:
  3. ...
  4. private:
  5. int c;
  6. private slots:
  7. void setVal(int);
  8. }
To copy to clipboard, switch view to plain text mode 

implement the slot as follows:
Qt Code:
  1. void MyClass::setVal(int value)
  2. {
  3. c = value;
  4. }
To copy to clipboard, switch view to plain text mode 

finally, change your connection to this:

Qt Code:
  1. QObject::connect(slider, SIGNAL(valueChanged(int)), this, SLOT(setVal(int)));
To copy to clipboard, switch view to plain text mode 

That ought to get you started