[Qgis-developer] how to know if QPainter comes from a print job ?

A Huarte ahuarte47 at yahoo.es
Mon Nov 4 07:29:47 PST 2013


Hi, Marco, finally I added a flag in 'QgsRenderContext' class indicating that it works in a 'print composition' task.
The ScaleFactor is distinct of 1 when the composition engine must paint the map to one specific map scale.

At any rate, thank you very much!





>________________________________
> De: Marco Hugentobler <marco.hugentobler at sourcepole.ch>
>Para: qgis-developer at lists.osgeo.org 
>Enviado: Lunes 4 de noviembre de 2013 11:37
>Asunto: Re: [Qgis-developer] how to know if QPainter comes from a print job ?
> 
>
>
>Hi 
>
>You cannot get that information from the painter itself (a print
      composition can be printed into QImage, pdf, QPrinter, etc...).
      The safest guess is probably to look at the QgsRenderContext. If
      the parameter 'scaleFactor' is very close to 1.0, it is most
      likely the rendering comes from a print composition.
>
>Regards,
>Marco
>
>On 04.11.2013 11:28, A Huarte wrote:
>
>Hi!
>>
>>
>>Within of qgis_core I need know if a QgsRenderContext comes from a print job (from composer) in order to disable one functionality.
>>
>>
>>I get that information from QPainter, QPaintDevice, QPaintEngine::Type ?
>>
>>
>>
>>Thank your very much!
>>
>>
>>
>>
>>_______________________________________________
Qgis-developer mailing list Qgis-developer at lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>-- 
Dr. Marco Hugentobler
Sourcepole -  Linux & Open Source Solutions
Weberstrasse 5, CH-8004 Zürich, Switzerland marco.hugentobler at sourcepole.ch http://www.sourcepole.ch Technical Advisor QGIS Project Steering Committee 
>
>_______________________________________________
>Qgis-developer mailing list
>Qgis-developer at lists.osgeo.org
>http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20131104/fbc1c7fb/attachment-0001.html>


More information about the Qgis-developer mailing list