I found another code on web and adjusted it to my project, but it's same as before. I really don't know what could be wrong and as well I don't understand you last tips - probably because I'm into Qt only few weeks. Here is my current code:
ui->graphicsView->setScene(scn);
scn
->addPixmap
(QPixmap::fromImage(*image
));
scn->setSceneRect(0,0,image->width(),image->height());
ui->graphicsView->fitInView(scn->sceneRect(),Qt::KeepAspectRatioByExpanding);
image = new QImage(filePath);
scn = new QGraphicsScene(this);
ui->graphicsView->setScene(scn);
scn->addPixmap(QPixmap::fromImage(*image));
scn->setSceneRect(0,0,image->width(),image->height());
ui->graphicsView->fitInView(scn->sceneRect(),Qt::KeepAspectRatioByExpanding);
To copy to clipboard, switch view to plain text mode
What can I do to fit image into this frame?
Thank you very much!
Bookmarks