I fear it isn't possible (at least with common programming skills!) to reproduce it.<div>My approach was too naive. The paintEngine instance is a pointer to a subclass implementation, and AFACS there's no method to change the flags (render features) of an instanciated engine...</div>
<div><br></div><div>giovanni</div><div><br><div class="gmail_quote">2012/7/5 G. Allegri <span dir="ltr"><<a href="mailto:giohappy@gmail.com" target="_blank">giohappy@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br><div class="gmail_quote"><div class="im">2012/7/5 Marco Hugentobler <span dir="ltr"><<a href="mailto:marco.hugentobler@sourcepole.ch" target="_blank">marco.hugentobler@sourcepole.ch</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>>made by Marco<br>
<br>
made by Jürgen (it fixes the pdf shift on windows).<br></div></div></blockquote><div><br></div></div><div>ops, sorry :)</div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><div>
<br>
Marco<br>
<br>
Am 05.07.2012 16:11, schrieb G. Allegri:<br>
</div>
<blockquote type="cite"><div><div>Vincent highlighted a hack in the composer PDF
rendering (made by Marco) [1].
<div>I was trying to reproduce it in Python, to test if it can
solve some problems in the Atlas plugin.</div>
<div>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):</div>
<div><br>
</div>
<div>paintE = self.getHackedPaintEngine</div>
<div>printE = printer.printEngine()</div>
<div>printer.setEngines(printE,paintE)</div>
<div><br>
</div>
<div>
<div>def getHackedPaintEngine(self):</div>
<div> class HackEngine(QPaintEngine):</div>
<div> def __init__(self):</div>
<div> QPaintEngine.__init__(self,</div>
<div> QPaintEngine.PrimitiveTransform</div>
<div> | QPaintEngine.PixmapTransform</div>
<div>
| QPaintEngine.PatternBrush</div>
<div> | QPaintEngine.AlphaBlend</div>
<div> | QPaintEngine.PainterPaths</div>
<div> | QPaintEngine.Antialiasing</div>
<div>
| QPaintEngine.BrushStroke</div>
<div> | QPaintEngine.ConstantOpacity</div>
<div> | QPaintEngine.MaskedBrush</div>
<div> | QPaintEngine.BlendModes</div>
<div>
| QPaintEngine.RasterOpModes</div>
<div> )</div>
<div> </div>
<div><span style="white-space:pre-wrap"> </span>return
HackEngine()</div>
</div>
<div>
<div><br>
</div>
<div>
What alternative way would you suggest to reproduce the hack?</div>
<div>giovanni</div>
<div><br>
</div>
<div>[1] <a href="https://github.com/qgis/Quantum-GIS/blob/master/src/app/composer/qgscomposer.cpp#L588" target="_blank">https://github.com/qgis/Quantum-GIS/blob/master/src/app/composer/qgscomposer.cpp#L588</a></div>
</div>
<div>[2] <a href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qprinter.html#setEngines" target="_blank">http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qprinter.html#setEngines</a></div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
Qgis-developer mailing list
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><span><font color="#888888">
</font></span></pre><span><font color="#888888">
</font></span></blockquote><span><font color="#888888">
<br>
<br>
<pre cols="72">--
Dr. Marco Hugentobler
Sourcepole - Linux & Open Source Solutions
Weberstrasse 5, CH-8004 Zürich, Switzerland
<a href="mailto:marco.hugentobler@sourcepole.ch" target="_blank">marco.hugentobler@sourcepole.ch</a> <a href="http://www.sourcepole.ch" target="_blank">http://www.sourcepole.ch</a>
Technical Advisor QGIS Project Steering Committee</pre>
</font></span></div>
<br>_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
<br></blockquote></div></div></div><br>
</blockquote></div><br></div>