[Qgis-developer] Referencing QgsComposerAttributeTable from a Print Composer Template

Nyall Dawson nyall.dawson at gmail.com
Thu May 28 04:24:13 PDT 2015


On 28 May 2015 at 21:08, Jakob Lanstorp <jlanstorp at gmail.com> wrote:
> When referencing a QgsComposerAttributeTable from a Print Composer template
> like this:
>
> composerView = composerList[0]
> composition = composerView.composition()
> attrtable = composition.getComposerItemById('MyComposerAttributeTable')
>
> I get a <class 'qgis._core.QgsComposerFrame'> returned in attrtable object.
> I would expect a QgsComposerAttributeTable?
>

Call multiFrame() on the frame to get a reference to its parent
attribute table. Tables can be split over multiple frames, so each
item is it's own frame. The attribute table is the parent multiframe
which controls what is displayed in each individual frame.

Nyall


More information about the Qgis-developer mailing list