[Qgis-developer] Building plugin for Print Composer

John Gitau gkahiu at gmail.com
Mon Jun 22 05:31:12 PDT 2015


Hi Jakob,

A workaround would be to have a plugin that creates a new composer view
object:

*custom_composer = self.iface.createNewComposer("My Composer")*

Then get a reference to the main window in the composer view:

*main_window = custom_composer.composerWindow()*

Then you can either add a new toolbar (and required actions) or append an
action to the main toolbar. Have a look at the ComposerWrapper class for
something similar we implemented for designing charts in the composer:
https://gist.github.com/gkahiu/06a43a589f9441736397

Hope this is helpful.

Cheers,

John

On Mon, Jun 22, 2015 at 2:07 PM, G. Allegri <giohappy at gmail.com> wrote:

> You can act on it but you can't custom gui widgets to the Composer
> interface.
> I cannot check the code right know. I listen to a specific (existing)
> composition opening but if I remember correctly you can watch the Composer
> opening too.
> Il 22/giu/2015 17:19, "Jakob Lanstorp" <jlanstorp at gmail.com> ha scritto:
>
>> Hi Giovanni, thanks for the update. Another solution would be to catch the
>> event when a user starts an existing print composer. Cannot in doc for the
>> pyqgis API find anything for this. Anyone who know is one can listens for
>> a
>> print composer to startup by the user and act on it.
>>
>>
>>
>> -----
>> Jakob Lanstorp
>> --
>> View this message in context:
>> http://osgeo-org.1560.x6.nabble.com/Building-plugin-for-Print-Composer-tp5212187p5212221.html
>> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150622/642290ec/attachment.html>


More information about the Qgis-developer mailing list