Hi all,

i am using QTimer to get Data from the parallel port at a given interval.
this is the code:

Qt Code:
  1. getData::getData(QWidget *parent) : QWidget(parent)
  2. {
  3. timer = new QTimer(this);
  4. }
  5.  
  6. void getData::set()
  7. {
  8. fft.Data();
  9. parport.setPortBi();
  10. clk = 0;
  11. }
  12.  
  13. void getData::startTimer()
  14. {
  15. connect(timer, SIGNAL(timeout()),this, SLOT(getData()));
  16. timer->start(0.2675);
  17. }
  18.  
  19. void getData::getData()
  20. {
  21. if(clk<22050)
  22. {
  23. parport.getdata();
  24. fft.DATA[clk] = parport.finData;
  25. clk++;
  26. }
  27. else
  28. {
  29. timer->stop();
  30. return;
  31. }
  32. }
To copy to clipboard, switch view to plain text mode 

now i want that after 22050 times it stops the timer and return. But it is not stopping and is continuing to enter the function that is connected with.

Do anyone now what i am doing wrong, or a different code that do the same function??

10x
Adrian