Check out example codes for "qgraphicsscene get viewport width". It will help you in understanding the concepts better.

Code Example 1

graphicsView->mapToScene(graphicsView->viewport()->geometry()).boundingRect()

Learn ReactJs, React Native from akashmittal.com