I am submitting a scaled down code of my application which has the fit in view problem.
In CMainWindow constructor, I am calling FitInView() so that the contents of the view are fit to the viewport at the initial display. But this thing doesnt work. I checked the zoom level before and after the scene->views().first()->fitInView(rect,Qt::KeepAspectRatio);. They work correctly when FIV button is pressed from the main window, but not when FitInView is called from the CMainWindow constructor.
When I press the FIV button after the main window is displayed, the contents are properly fitted onto the viewport.
Why doesnt FitInView work properly in the constructor of the main window ?? Is it a bug or am I mising something ??
Bookmarks