title: QCamera cannot capture by for loop
body: <p>For Some Reason, I need use pyqt to capture image instead of cv2.</p>
  <p>My purpose is iterate cameras in my PC,
  then take picture automatically.</p>
  <p>The code below is work by manually change QComboBox, but fail by for loop.</p>
  <p>I have tried many ways, like QThread.sleep, time.sleep, QCamera.stop, even launch by QThread.</p>
  <pre><code>from PyQt5.QtWidgets import *
  from PyQt5.QtMultimedia import *
  from PyQt5.QtMultimediaWidgets import *
  import os, sys, time
  
  class MainWindow(QMainWindow):
      def __init__(self):
          super().__init__()
          self.cameras = QCameraInfo.availableCameras()
  
          # this part doesn't work correctly, only last one worked     
          for i, cam in enumerate(self.cameras):
              self.select_camera(i)
              time.sleep(10)
  
          toolbar = QToolBar(&quot;Camera Tool Bar&quot;)
          self.addToolBar(toolbar)
          camera_selector = QComboBox()
          camera_selector.addItems([f'{i}.{cam.description()}' for i, cam in enumerate(self.cameras)])
          camera_selector.currentIndexChanged.connect(self.select_camera)
          toolbar.addWidget(camera_selector)
          self.show()
  
      def select_camera(self, i):
          print(f&quot;{i=:}&quot;)
          self.camera = QCamera(self.cameras[i])
          self.camera.setCaptureMode(QCamera.CaptureStillImage)
          self.camera.start()
          self.capture = QCameraImageCapture(self.camera)
          timestamp = time.strftime(&quot;%d-%b-%Y-%H_%M_%S&quot;)
          self.capture.capture(os.path.join(os.getcwd(), f&quot;{i}.{timestamp}.jpg&quot;))
  
  if __name__ == &quot;__main__&quot;:
      App = QApplication(sys.argv)
      window = MainWindow()
      sys.exit(App.exec())
  </code></pre>