I am trying to built a re-sizable widget consisting of svgGrapicItem and I am facing a issue with the resizeEvent. When the widget first initialize, it triggers the resizeEvent which call the graphicView.fitInView function, but the svgGraphicItem does not resize properly. However when the the widget is resized and the resizeEvent is triggered again, the svgGraphicItem was able to resize properly. Does this have anything to do with the lifecycle of the widget initialization?

Below are the images to illustrate the problem.

After Initialization
init.png

After a resize action
resized.png

Any pointers will be greatly appreciated.