Vincent highlighted a hack in the composer PDF rendering (made by Marco)
[1].
I was trying to reproduce it in Python, to test if it can solve some
problems in the Atlas plugin.
I thought I could use the QPrinter.setEngines() method [2], to set an
instance of a derived QPaintEngine intitated with the flags provided in the
hack, but this method makes QGis crash. I was doing something like this
(excerpt):

paintE = self.getHackedPaintEngine
printE = printer.printEngine()
printer.setEngines(printE,paintE)

def getHackedPaintEngine(self):
        class HackEngine(QPaintEngine):
            def __init__(self):
                QPaintEngine.__init__(self,
                    QPaintEngine.PrimitiveTransform
                  | QPaintEngine.PixmapTransform
                  | QPaintEngine.PatternBrush
                  | QPaintEngine.AlphaBlend
                  | QPaintEngine.PainterPaths
                  | QPaintEngine.Antialiasing
                  | QPaintEngine.BrushStroke
                  | QPaintEngine.ConstantOpacity
                  | QPaintEngine.MaskedBrush
                  | QPaintEngine.BlendModes
                  | QPaintEngine.RasterOpModes
                )

return HackEngine()

What alternative way would you suggest to reproduce the hack?
giovanni

[1]
https://github.com/qgis/Quantum-GIS/blob/master/src/app/composer/qgscomposer.cpp#L588
[2]
http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qprinter.html#setEngines
_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to