title: Trying to display opencv video in QGraphicsScene and QGraphicsView but Nothing shows up
body: <p>I have a GUI app that I wrote in Python and I'm trying to display video in Qt app.</p>
  
  <p>It uses a QGraphicsScene and QGraphicsView to display images but now I have to display a video. When I try to display  a video here is what I do:</p>
  
  <p>First, I create VideoCapture from cv2 package. After that I run loop and read frame in every iteration which is then casted into QPixmap (this is done correctly, I checked on a single frame). I return that QPixmap object to the Class which holds QGraphicsScene and QGraphicsView and try to add it to the scene.</p>
  
  <p>Thing is, only when the video ends, the last frame is displayed, throughout video playing time I'm welcomed with this sighting</p>
  
  <p><a href="https://i.stack.imgur.com/hmERj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hmERj.png" alt="A blank non responsive screen"></a></p>
  
  <p>The loop that I mentioned earlier looks like this:</p>
  
  <pre><code>    self.imageViewer.start_capturing()
      self.timer = QtCore.QTimer()
      self.fps = 24
  
      while True:
          retVal = self.imageViewer.read_frame()
          if not retVal:
              self.timer.stop()
              break
          self.timer.start(1000./self.fps)
      self.imageViewer.stop_capturing()
  </code></pre>
  
  <p>self.ImageViewer is a component which holds the QGraphicsScene and QGraphicsView
  I also put timer here so that it displays proper ammount of fps but it doesn't help.</p>
  
  <p>The GUI app itself shows QGraphicsView with some buttons</p>
  
  <pre><code>middleLayout.addWidget(self.imageViewer.view)
  </code></pre>
  
  <p>This is what I mean. So it doesn't show <code>imageViewer</code> but it shows a subclass of <code>QGraphicsView</code></p>
  
  <p>Here is the code from read_frame method in ImageViewer class. </p>
  
  <pre><code>def read_frame(self):
      """
      Reads a frame from the video, if video ended, then False is returned.
      If there is a successful reading then True is returned
      :return: True if video is read successfully, False otherwise.
      """
      retVal, self.current_frame = self.capture.getFrame()
      if not retVal:
          return False
      else:
          self.pixmap = retVal
          self.scene.addPixmap(self.pixmap)
          return True
  </code></pre>
  
  <p>The method <code>self.capture.getFrame()</code> just returns QPixmap item and CV::mat item. </p>
  
  <p>This whole process is done correctly because I tried manually reading frame by frame and everything worked OK, but when I try to display video the app freezed like shown in image above. So I manually tried to do the whole described process by manually clicking a button which loads me frame and puts it onto the QGraphicsScene so I assume that the core of the app works correctly (and I even tried to get roughly 5-7 fps by clicking fast :D )</p>
  
  <p>I hope I made my problem clear and included all code that is needed.</p>