Unsolved QGraphicScene
-
Hi
I use a QGraphicScene to display a grayscale image. On this grayscale image I draw an overlay that is a rectangle.
I do it in this way.
QGraphicsScene m_scene;
QPixmap imTmp = QPixmap::fromImage(m_displayImage); // m_displayImage is a QImage
m_displayImagePtr = m_scene.addPixmap(imTmp);
m_externalOverlayImagePtr = m_scene.addPixmap(overlayIm); //overlayIm is a QPixmap containing only the rectangleMany time the rectangle is not displayed completely. One or two sides are missing. If I play with the size of my window I'm able to get a size where I have entire rectangle. I have a window resize function that permit to resize the image to keep it maximized in the display and keeping the aspect ratio. I have played with setZValue of the rectangle item without success.
Thank you
-
Hi,
Shouldn't you breathe use QGraphicsScene::fitInView ?