[QGIS-Developer] My own LayoutItem not getting rendered unless ...

Raymond Nijssen r.nijssen at terglobo.nl
Mon Sep 11 01:21:23 PDT 2023


Hi,

For a plugin I made my own type of layoutItem which renders some kind of 
special graph. However, when the code adds the item to a layout, the 
rectangle is there but the content does not get rendered.

Now when I run this line in the console:

layout_manager = QgsProject.instance().layoutManager()

the layout item does get rendered, and also every next layout works 
properly. I put the line of code just above my layout item's class 
definition and it solves the problem. But I'd like to know if this is 
the right approach and why this line of code is needed. (Or if this is a 
bug?)

Thanks!

Raymond









More information about the QGIS-Developer mailing list