<div dir="ltr">We have talked a lot with Nyall about this. It was a requirement for a work I was developing some months ago (it's what I was describing some emails ago in this thead).<div>I suppose the work Nyall is talking about is the deep refactoring of the Composer which will converge in the Report engine (QGIS > 3.x), is it right?</div><div><br></div><div>giovanni</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-08-08 11:19 GMT+02:00 Nyall Dawson <span dir="ltr"><<a href="mailto:nyall.dawson@gmail.com" target="_blank">nyall.dawson@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><p dir="ltr"><br>
On 7 Aug 2015 6:58 pm, "Vincent Mora" <<a href="mailto:vincent.mora@oslandia.com" target="_blank">vincent.mora@oslandia.com</a>> wrote:<br>
><br>
> Hi all,<br>
><br>
> I need to add graphs generated by a plugin to compositions. I'm considering to develop a PluginComposerItem in the same spirit as PluginLayers, adding/removing a button in the toolbar when the plugin is registered/removed.</p>
</span><p dir="ltr">Just a warning that similar work is already underway - adding a composer item type registry so that plugins can register their own custom item types. </p>
<p dir="ltr">It's an extensive work though, because composer has a lot of hard coded handling of all the existing item types (checkout all the item specific methods in QgsComposition/QgsComposerView). That's why this work is tied up with the layouts/reporting framework refactor.</p><span class="HOEnZb"><font color="#888888">
<p dir="ltr">Nyall<br></p></font></span><div class="HOEnZb"><div class="h5">
<p dir="ltr">><br>
> Is that what was needed in your cases, or was a more general approach required (like the qgis plugin mechanism, being able to access the interface) ?<br>
><br>
> V.<br>
><br>
><br>
> Le 22/06/2015 18:05, G. Allegri a écrit :<br>
>><br>
>> The suggestion from John is exactly what we did too. And we also built a chart composer...<br>
>><br>
>> It would be great to have the means to know what other teams are working to. It would save a lor of time and money and, probably, get better software from a shared effort ;)<br>
>><br>
>> giovanni<br>
>><br>
>> Il 22/giu/2015 19:31, "John Gitau" <<a href="mailto:gkahiu@gmail.com" target="_blank">gkahiu@gmail.com</a>> ha scritto:<br>
>>><br>
>>> Hi Jakob,<br>
>>><br>
>>> A workaround would be to have a plugin that creates a new composer view object: <br>
>>><br>
>>> custom_composer = self.iface.createNewComposer("My Composer")<br>
>>><br>
>>> Then get a reference to the main window in the composer view:<br>
>>><br>
>>> main_window = custom_composer.composerWindow()<br>
>>><br>
>>> 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: <a href="https://gist.github.com/gkahiu/06a43a589f9441736397" target="_blank">https://gist.github.com/gkahiu/06a43a589f9441736397</a><br>
>>><br>
>>> Hope this is helpful.<br>
>>><br>
>>> Cheers,<br>
>>><br>
>>> John<br>
>>><br>
>>> On Mon, Jun 22, 2015 at 2:07 PM, G. Allegri <<a href="mailto:giohappy@gmail.com" target="_blank">giohappy@gmail.com</a>> wrote:<br>
>>>><br>
>>>> You can act on it but you can't custom gui widgets to the Composer interface.<br>
>>>> 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.<br>
>>>><br>
>>>> Il 22/giu/2015 17:19, "Jakob Lanstorp" <<a href="mailto:jlanstorp@gmail.com" target="_blank">jlanstorp@gmail.com</a>> ha scritto:<br>
>>>>><br>
>>>>> Hi Giovanni, thanks for the update. Another solution would be to catch the<br>
>>>>> event when a user starts an existing print composer. Cannot in doc for the<br>
>>>>> pyqgis API find anything for this. Anyone who know is one can listens for a<br>
>>>>> print composer to startup by the user and act on it.<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> -----<br>
>>>>> Jakob Lanstorp<br>
>>>>> --<br>
>>>>> View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Building-plugin-for-Print-Composer-tp5212187p5212221.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/Building-plugin-for-Print-Composer-tp5212187p5212221.html</a><br>
>>>>> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.<br>
>>>>> _______________________________________________<br>
>>>>> Qgis-developer mailing list<br>
>>>>> <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
>>>>> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>>>><br>
>>>><br>
>>>> _______________________________________________<br>
>>>> Qgis-developer mailing list<br>
>>>> <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
>>>> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> Qgis-developer mailing list<br>
>>> <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
>>> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Qgis-developer mailing list<br>
>> <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Qgis-developer mailing list<br>
> <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</p>
</div></div><br>_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Giovanni Allegri<br><a href="http://about.me/giovanniallegri" target="_blank">http://about.me/giovanniallegri</a></div><div dir="ltr">Gis3W - <a href="http://gis3w.it" target="_blank">http://gis3w.it</a></div><div dir="ltr">Ikare - <a href="http://ikare.it" target="_blank">http://ikare.it</a><br><div>Twitter: <a href="https://twitter.com/_giohappy_" target="_blank">https://twitter.com/_giohappy_</a></div><div>blog: <a href="http://blog.spaziogis.it" target="_blank">http://blog.spaziogis.it</a><br>GEO+ geomatica in Italia <a href="http://bit.ly/GEOplus" target="_blank">http://bit.ly/GEOplus</a></div></div></div></div></div>
</div>