[Qgis-developer] Creating a new QgsComposerHtml from Python causes segmentation fault

Akbar Gumbira akbargumbira at gmail.com
Mon Jan 19 18:48:57 PST 2015


Hi,

When we call getComposerItemById, it will return QgsComposerItem, which can
be many things: QgsComposerLabel, QgsComposerLegend, QgsComposerFrame,
QgsComposerPicture, etc. In case of the item is html frame, it will return
QgsComposerFrame. Unlike other items that you can get the component
directly, to get the QgsComposerHTML itself you should do:

html_item = mycomp.getComposerItemById('myhtml')
composer_html = mycomp.getComposerHtmlByItem(html_item)

Regards

On Tue, Jan 20, 2015 at 7:11 AM, G. Allegri <giohappy at gmail.com> wrote:

> The QgsComposerHtml class behaves bad from Python.
> When a new QgsComposerHtml is instantiated I get a segmentation fault and
> QGIS crashes.
> Something wrong happens even when one tries to obtain an existing object
> from a composition:
>
> mycomp.getComposerItemById('myhtml') -> QgsComposerFrame instance
>
> I don't understand how a QgsComposerFrame is returned given that
> QgsComposerHtml is not related to this class. It derives from
> QgsComposerMultiFrame, and in case it can contains frame objects...
>
> It happens both on 2.6 and master, both on Linux and Windows.
>
> I've opened an issue: http://hub.qgis.org/issues/12009
>
> giovanni
>
> --
> Giovanni Allegri
> http://about.me/giovanniallegri
> Twitter: https://twitter.com/_giohappy_
> blog: http://blog.spaziogis.it
> GEO+ geomatica in Italia http://bit.ly/GEOplus
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 

*-------------------*

*Akbar Gumbira*
*Software Engineer*
*Geospatial, NLP, Data Mining, Machine Learning, Artificial Intelligence*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150120/46b8a233/attachment.html>


More information about the Qgis-developer mailing list