[Interest] Problems with transformed QPainter and Non-Solid Brush

Andreas Schuller andreas.schuller at student.tugraz.at
Mon Aug 12 16:45:23 CEST 2013


Hello,

I am using a transformed QPainter to draw some filled polygons with a 
non-solid brush style (e.g. Qt::Dense1Pattern). The painter gets 
transformed according to the zoom factor, the translation and the 
rotation chosen by the user. The scene is drawn in the paint method of a 
QQuickPaintedItem derived class (Qt5.1) using ‘Image’ as render target. 
Unfortunately, antialising artifacts appear within the filled polygons, 
when the user zooms in and out.

It seems, that the artifacts are caused by the transformation of the brush.

The first workaround, that came into my mind, was to set the inverse 
transformation of the painter on the brush. Doing it this way, the 
orientation of the fill pattern stays the same when the view gets 
rotated but this is neglectable at the moment.

Is there a better solution for this problem than setting the inverse 
transformation on the brush?

P.S.: I have already posted this question in the Qt Forum 'General and 
Desktop', see http://qt-project.org/forums/viewthread/31097, including a 
screenshot of the aforementioned artifacts. In reply to my question I 
got the tip to bring the question to this mailing list.


Thanks for your advice and suggestions.

Andreas





More information about the Interest mailing list