Re: [Qgis-developer] Referencing QgsComposerAttributeTable from a Print Composer Template
Thanks for the documentation. It's working: attrtable = composition.getComposerItemById('MyComposerAttributeTable').multiFrame() returns a QgsComposerAttributeTable Jakob - Jakob Lanstorp -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Referencing-QgsComposerAttributeTable-from-a-Print-Composer-Template-tp5207995p5207998.html Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
Re: [Qgis-developer] Referencing QgsComposerAttributeTable from a Print Composer Template
On 28 May 2015 at 21:08, Jakob Lanstorp 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 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 ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer
[Qgis-developer] Referencing QgsComposerAttributeTable from a Print Composer Template
When referencing a QgsComposerAttributeTable from a Print Composer template like this: composerView = composerList[0] composition = composerView.composition() attrtable = composition.getComposerItemById('MyComposerAttributeTable') I get a returned in attrtable object. I would expect a QgsComposerAttributeTable? Need to set a filter on the attribute table in the print composer. Since the composer is large with a lot of items, I have made the template in the print composer and getting the items with getComposerItemById('MyItemId'). If I build the composer from scratch in Python, I can of course use the QgsComposerAttributeTable, but is not an option here. - Jakob Lanstorp -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Referencing-QgsComposerAttributeTable-from-a-Print-Composer-Template-tp5207995.html Sent from the Quantum GIS - Developer mailing list archive at Nabble.com. ___ Qgis-developer mailing list Qgis-developer@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/qgis-developer