I fit my scene for view's size, but it's content has some margins on right and bottom sides.
m_ui.graphicsView->fitInView(m_scene->sceneRect(), Qt::IgnoreAspectRatio);
Can I avoid this behavior?
I fit my scene for view's size, but it's content has some margins on right and bottom sides.
m_ui.graphicsView->fitInView(m_scene->sceneRect(), Qt::IgnoreAspectRatio);
Can I avoid this behavior?
I think you're misunderstanding the point of the fitInView function. it's there to ensure that the given rect area of the scene is visible in the view. As the docs state: -
Scales the view matrix and scrolls the scroll bars to ensure that the scene rectangle rect fits inside the viewport. rect must be inside the scene rect; otherwise, fitInView() cannot guarantee that the whole rect is visible.