O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The viewport's coordinate system

The view consists of the viewport and two scrollbars. The viewport is a subwidget that actually contains the content of the scene. The view performs conversion from the scene coordinates to the viewport coordinates based on multiple parameters.

First, the view needs to know the bounding rectangle of everything we could want to see in the scene. It's called the scene rect and is measured in the scene's coordinate system. By default, the scene rect is the bounding rectangle of all items that were added at the scene since it was created. This is usually fine, but if you move or delete an item, that bounding rectangle will not shrink (because of performance reasons), so it may result in showing a lot of unwanted ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required