title: How to use a mask with QPainter?
body: <p>I have a shape (in blue) loaded from a PNG with transparency:</p>
  
  <p><img src="https://i.stack.imgur.com/uSXRX.png" alt="enter image description here"></p>
  
  <p>Then I'm drawing several circles on top of this shape (in red) with <code>QPainter::drawEllipse</code>.</p>
  
  <p><img src="https://i.stack.imgur.com/DJnlC.png" alt="enter image description here"></p>
  
  <p>The result of that is somewhat similar to the third picture with the red shape completely covering the blue one:</p>
  
  <p><img src="https://i.stack.imgur.com/QUOIi.png" alt="enter image description here"></p>
  
  <p>What I would like however is for the blue shape to act as a mask to the red one, with a result like this:</p>
  
  <p><img src="https://i.stack.imgur.com/UviSd.png" alt="enter image description here"></p>
  
  <p>Is it possible to do that with QPainter?</p>