Qt Code:
  1. void MainWindow::cattura()
  2. {
  3. cameraTimer.start(33); // 33 ms = 30 fps
  4. connect(&cameraTimer, SIGNAL(timeout()),this,SLOT(cameraTimerTimeout()));
  5.  
  6. return;
  7.  
  8. }
To copy to clipboard, switch view to plain text mode 

Since "cameraTimer" is a member variable of MainWindow, this connect() statement should be made in the MainWindow constructor, not in this slot.

What will happen in the code above is that each time you push the capture button, you will make *another* connection to the camera timeout signal. So, the first time you push the button, the slot will be called once on timeout. The second time, it will be called twice, the third time it will be called three times, and so on. By the time you get to 10 pushes, you'll be saying "CIAO" so many times you will wish it really was leaving.