[Qgis-developer] Segfault when using QgsComposition::exportAsPDF with QGIS 2.4 and python

kimaidou kimaidou at gmail.com
Mon Jul 7 10:20:03 PDT 2014


Hi all,

I would like to share an issue I am having while trying to simply export a
composition as PDF.

Under QGIS 2.2, I had no problem, but QGIS 2.4 Segfault with the simple
steps :

c = QgsComposition( QgsMapSettings() )
c.setPaperSize( 290, 210 )
c.setPrintResolution( 100 )
c.setSnapGridOffsetX( 3.5 )
c.setSnapGridOffsetY( 0 )
c.setSnapGridResolution( 2.5 )
c.setNumPages( 1 )

cl = QgsComposerLabel( c )
cl.setItemPosition( 0, 10, 100, 100 )
content = 'test'
cl.setText( content )
cl.setFrameEnabled( False )
c.addItem( cl )

c.exportAsPDF( '/tmp/test.pdf' )

NB: I just discoverd that QgsComposition( QgsMapRenderer() ) is deprecated
since QGIS 2.4 as explained here: http://www2.qgis.org/api/deprecated.html
But using it or the new instanciation does not change the problem.

Has anyone any hint on this issue ?

Thanks in advance
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140707/6f6c74c3/attachment-0001.html>


More information about the Qgis-developer mailing list