[Qgis-developer] Python bindings for composer
Hugentobler Marco
marco.hugentobler at karto.baug.ethz.ch
Thu Feb 26 02:37:52 EST 2009
Hi QGIS devs
I'd like to make Python bindings for the composer classes such that it is possible for plugins to automatically create and place items on the composer. I already did some tests about it (accidental commit yesterday :-( )
With the bindings for composer classes it should be possible to place QActions defined in Python plugins into the composer toolbar.
Therefore I propose the following additional function into the plugin interface (QgisInterface):
QList< QPair <QMainWindow*, QgsComposerView*> > composerList()
Like this, plugins can add gui elements to the main composer window and add items to the composer view. Not exposed is the class QgsComposer as that class manages the composer input widgets and I don't like to expose them to the plugin interface. It is a list because it is planned to allow several composer instances per projects in the future.
The following additional classes would be visible from plugins:
core:
QgsComposerItem, QgsComposerLabel, QgsComposerMap, QgsComposerPicture, QgsComposerScaleBar, QgsComposition, QgsLegendModel, QgsPaperItem, QgsScaleBarStyle
gui:
QgsComposerView
Let me know what you think about this or if you see better ways to expose print composer classes.
Regards,
Marco
More information about the Qgis-developer
mailing list