Hi, my program is about animating the motion of the upper arm. currently there is 4 objects on my GUI. one is panelGL which displays the animation. then there is the horizontal slider, play button and reset button. i will first like to connect the slider to my panelGL so that the animation can be controlled by the slider. then i will like to connect the reset button and play button to the slider. the reset button will reset the value of the slider and thus also reset the animation to the initial position. the play button will start moving the slider, thus resulting in the animation of the arm from start till the end.

the problem i'm currently facing is as follows
Qt Code:
  1. Object::connect: No such slot MyPanelOpenGL::counterChanged(int) in mainwindow.cpp:19
  2. Object::connect: (sender name: 'horizontalSlider')
  3. Object::connect: (receiver name: 'panelGL')
  4. Object::connect: No such slot QSlider::SetSliderValue() in mainwindow.cpp:20
  5. Object::connect: (sender name: 'ResetButton')
  6. Object::connect: (receiver name: 'horizontalSlider')
  7. Object::connect: No such slot QSlider::animate() in mainwindow.cpp:21
  8. Object::connect: (sender name: 'PlayButton')
  9. Object::connect: (receiver name: 'horizontalSlider')
To copy to clipboard, switch view to plain text mode 

Any help will be appreciated and my code is
Qt Code:
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3. #include <QTimer>
  4. #include "main.h"
  5. #include <QDebug>
  6.  
  7.  
  8.  
  9. extern QList<FileData> points;
  10. int counter=0;
  11.  
  12. MainWindow::MainWindow(QWidget *parent) :
  13. QMainWindow(parent),
  14. ui(new Ui::MainWindow)
  15. {
  16. ui->setupUi(this);
  17.  
  18.  
  19. connect(ui->horizontalSlider, SIGNAL(valueChanged(int)),ui->panelGL, SLOT(counterChanged(int)));
  20. connect(ui->ResetButton,SIGNAL(clicked()), ui->horizontalSlider, SLOT(SetSliderValue()));
  21. connect(ui->PlayButton,SIGNAL(clicked()), ui->horizontalSlider, SLOT(animate()));
  22.  
  23. }
  24.  
  25. void MainWindow::counterChanged(int counter)
  26. {
  27. counter = ui->horizontalSlider->value();
  28. }
  29.  
  30. void MainWindow::SetSliderValue()
  31. {
  32.  
  33. ui->horizontalSlider->setValue(0);
  34.  
  35. }
  36.  
  37.  
  38. void MainWindow::animate()
  39. {
  40.  
  41. if ( counter < points.size()-1 )
  42. {
  43. QTimer *timer = new QTimer(this);
  44. connect(timer, SIGNAL(timeout()), this, SLOT(update()));
  45. counter++;
  46. timer->start(1000);
  47.  
  48. }
  49. }
  50.  
  51.  
  52.  
  53.  
  54. MainWindow::~MainWindow()
  55. {
  56. delete ui;
  57. }
To copy to clipboard, switch view to plain text mode