QT를 사용하여 매우 간단한 이미지 뷰어를 개발하려고합니다. 나는 QGraphicsScene
위젯에 이미지를 표시하려면 다음 코드를 사용하고 있습니다 : 이Qt : QGraphicscene을 사용하여 이미지를 표시합니다.
가 어떻게이 GraphicsScene
에 이미지를 넣을 수 :
QImage image(fileName);
firstPicture = new QGraphicsScene();
firstPicture->addPixmap(QPixmap::fromImage(image));
ui->graphicsView->setScene(firstPicture);
ui->graphicsView->fitInView(firstPicture->sceneRect() ,Qt::KeepAspectRatio);
나는 다음과 같은 출력을 무엇입니까?