I'm writing a program where you move a slider and the number on QLCDNumber changes accordingly. I want to add a couple of buttons which will change the base of the slider (from decimal base to binary/hexadecimal).
This is the code that i've written - the main line is in bold.
The program compiles - but when I click on the button, the base doesn't change.
What's wrong here?

Qt Code:
  1. QLCDNumber *lcd=new QLCDNumber(3,this);
  2. lcd->setMode(QLCDNumber::Dec);
  3. lcd->setGeometry(50,25,100,100);
  4.  
  5. QSlider *slide = new QSlider(Qt::Horizontal,this);
  6. slide->setRange(0,100);
  7. slide->setValue(0);
  8. slide->setGeometry(50,125,100,25);
  9.  
  10. connect(slide,SIGNAL(sliderMoved(int)),lcd,SLOT(display(int)));
  11.  
  12. QPushButton *hex = new QPushButton("Hexadecimal",this);
  13. hex->setFont(QFont("Times",12));
  14. hex->setGeometry(50,200,100,25);
  15.  
  16. [B]connect(hex,SIGNAL(clicked()),lcd,SLOT(setMode(QLCDNumber::Hex)));[/B]
To copy to clipboard, switch view to plain text mode