How it works...
When drawing images with Qt, the sequence of calling the drawImage() function will determine which image is being rendered first and which one is rendered later. This will affect the depth order of the images and yield different outcomes. In the previous example, we called drawImage() function four times to draw four different images onscreen. The first drawImage() function renders checker.png, and the second drawImage() function renders tux.png (the penguin). The image that gets rendered later will always appear in front of the others, which is why the penguin is showing in front of the checker pattern. The same goes for the butterfly and the checker on the right. The reason why you can still see the checker even though the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access