<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">>made by Marco<br>
      <br>
      made by Jürgen (it fixes the pdf shift on windows).<br>
      <br>
      Marco<br>
      <br>
      Am 05.07.2012 16:11, schrieb G. Allegri:<br>
    </div>
    <blockquote
cite="mid:CAB4g1=xSO1ALkDx7RZYLzRxpM1ZwofOQtWAQ3k3JOjYC-pEWsA@mail.gmail.com"
      type="cite">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 class="Apple-tab-span" style="white-space:pre"> </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 moz-do-not-send="true"
href="https://github.com/qgis/Quantum-GIS/blob/master/src/app/composer/qgscomposer.cpp#L588">https://github.com/qgis/Quantum-GIS/blob/master/src/app/composer/qgscomposer.cpp#L588</a></div>
      </div>
      <div>[2] <a moz-do-not-send="true"
href="http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qprinter.html#setEngines">http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qprinter.html#setEngines</a></div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Qgis-developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Dr. Marco Hugentobler
Sourcepole -  Linux & Open Source Solutions
Weberstrasse 5, CH-8004 Zürich, Switzerland
<a class="moz-txt-link-abbreviated" href="mailto:marco.hugentobler@sourcepole.ch">marco.hugentobler@sourcepole.ch</a> <a class="moz-txt-link-freetext" href="http://www.sourcepole.ch">http://www.sourcepole.ch</a>
Technical Advisor QGIS Project Steering Committee</pre>
  </body>
</html>