title: How to display an image at full width in Qt QGraphicsView?
body: <p>I'm using this code to load image and show in screen.</p>
  
  <pre><code>void MainWindow::on_actionOpen_triggered(void){
  
      QString fileName;
      fileName = QFileDialog::getOpenFileName(this,
          tr("Open Image"), "C:\\Users", tr("Image Files (*.png *.jpg *.jpeg *.bmp)"));
  
  
      qim.load( fileName );
      pixmap = QPixmap::fromImage( qim );
      scene.clear();
      scene.addPixmap( pixmap );
      ui-&gt;graphicsView-&gt;setScene(&amp;scene);
  
  }
  </code></pre>
  
  <p>But when I upload a small picture, it doesn't fill the screen and it appears in its original size. As you can see:</p>
  
  <p><a href="https://i.stack.imgur.com/8yC4T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8yC4T.png" alt="enter image description here"></a></p>
  
  <p>The desired screen should look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/hYhcg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hYhcg.png" alt="enter image description here"></a></p>
  
  <p>(I am trying to make an application similar to <a href="https://setosa.io/ev/image-kernels/" rel="nofollow noreferrer">this site</a>. Grayscale doesn't matter.)</p>
  
  <p>image used:
  <a href="https://i.stack.imgur.com/2ZgIN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2ZgIN.jpg" alt="enter image description here"></a></p>