I’m trying to scale a image to fit in the QGraphicView.
Then you should scale to QGraphicsView's hieght.
//QPixmap scaledImage = QPixmap(originalImage.scaledToHeight( (int) mScene->height(), Qt::SmoothTransformation) );
QPixmap scaledImage
= originalImage.
scaledToHeight(ui
->graphicsView
->height
(), Qt
::SmoothTransformation);
//QPixmap scaledImage = QPixmap(originalImage.scaledToHeight( (int) mScene->height(), Qt::SmoothTransformation) );
QPixmap scaledImage = originalImage.scaledToHeight(ui->graphicsView->height(), Qt::SmoothTransformation);
To copy to clipboard, switch view to plain text mode
Bookmarks