It's not clear but if line 30 is the first time that the view is show()n then at line 29 the view has no dimensions and, as the QGraphicsView::fitInView() docs say:
After the first time through this code the views are all visible and have dimensions.If rect is empty, or if the viewport is too small, this function will do nothing.
Bookmarks