You have not set the sceneRect for QGraphicsScene....

Qt Code:
  1. image = new QImage(data.absoluteFilePath()); // variable data is defined when calling this method and object image is defined as QImage in header
  2. scn = new QGraphicsScene(this); // object defined in header
  3. // scn->setSceneRect(ui->graphicsView->Rect()); // SOMETHING LIHE THIS
  4. ui->graphicsView->setScene(scn);
  5. scn->addPixmap(QPixmap::fromImage(*image));
  6. ui->graphicsView->fitInView(scn->itemsBoundingRect(),Qt::KeepAspectRatio);
To copy to clipboard, switch view to plain text mode