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

Marco Hugentobler marco.hugentobler at sourcepole.ch
Mon Nov 4 02:37:58 PST 2013


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20131104/f82fb98b/attachment.html>


More information about the Qgis-developer mailing list