Sorry, because of my poor English I probably wasn't clear enough in my first post.
A QPainter graphic should be drawn into a QImage. And this QImage is saved to a file (not drawn on screen).
When the QPainter graphic is drawn into the QImage the size of the graphic isn't known before. The graphic size can vary a third of its size. But the graphic resolution should stay always fixed! So scaling the graphic is no option. But the size of the QImage should be sized / resize to the size of the QPainter graphic!
Now I first create a QImage with the maximal size the QPainter graphic can reach. And then the QPainter graphic is drawn into this QImage. But in this way most of the time the QImage is much larger than its graphic content. Because the graphic always begins in the upper left corner the blank white parts of the QImage are on its right and lower side.
The question is how to shrink the QImage to the size of its fixed size graphic content? Or how to cut the blank parts of the QImage so the QImage got exact the size of its graphic content?
Bookmarks