Hey there guys, maybe it´s a simple task but it´s driving me a little bit crazy, especially QTime.
I´m learning minute by minute but sometimes I just need to ask something as I really need help.

What I would like to do is:
1- Press START button and every ´x´ seconds the MAIN FUNCTION is called, exactly like I would do in a for cycle and it must stop when I click STOP.
2- Press STOP button and I exit the loop;

Right now I have this:

Qt Code:
  1. void MainWindow::on_pushButton_START_clicked()
  2. {
  3. ... here is the button that I want to use to START the loop of the main function. Every ´x´ seconds MAIN FUNCTION loops.
  4. }
  5.  
  6. void MainWindow::on_pushButton_STOP_clicked()
  7. {
  8. ... here is the button that I want to use to STOP the loop of the main function...
  9. }
  10.  
  11. void MainWindow::on_pushButton_MAIN_FUNCTION_clicked()
  12. {
  13. ... here is the function I want to loop...
  14. }
To copy to clipboard, switch view to plain text mode