[Interest] Zooming with QGraphicsView/QGraphicsItem

Israel Brewster ijbrewster at alaska.edu
Wed Aug 7 20:01:09 CEST 2019

I have a QGraphicsScene/QGraphicsView that I am using to display a map (and some data). The map is in the mercator projection, with the x and y coordinates of the scene corresponding to map coordinates, so the background images are rather large. Images are loaded into a QGraphicsObject which is then added to the scene. The object types are defined by a third-party library, so I don’t have the option of using different objects, such as QGraphicsPixmapObject or something.

This works fine when I’m zoomed in to the map. Coastlines are nice and sharp, with no issues:

However, when I zoom out, the coastline becomes quite pixelated, and difficult to see in places:

How can I fix this? My first thought was to change the size of the background image so it could scale better, but that didn’t seem to help. In retrospect, this makes sense: at the end of the day, the background image has to be the correct size for the mercator projection, so while I can certainly change the pixel density, the overall size, and thus how much scaling is needed to display a given area, is fixed.

Israel Brewster
Software Engineer
Alaska Volcano Observatory 
Geophysical Institute - UAF 
2156 Koyukuk Drive 
Fairbanks AK 99775-7320
Work: 907-474-5172
cell:  907-328-9145

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190807/9b2b5797/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2019-08-07 at 9.50.10 AM.png
Type: image/png
Size: 160767 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190807/9b2b5797/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2019-08-07 at 9.50.28 AM.png
Type: image/png
Size: 254295 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190807/9b2b5797/attachment-0001.png>

More information about the Interest mailing list