<div dir="ltr">Hi Nyall,<div><br></div><div>In my case, I maintain all the plugins myself for internal usage.</div><div><br></div><div>Thanks for your advice as well.</div><div><br></div><div><br></div><div>Regards,</div><div><br></div><div>Zac</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 23 Apr 2021 at 15:07, Nyall Dawson <<a href="mailto:nyall.dawson@gmail.com">nyall.dawson@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, 23 Apr 2021 at 13:08, Etienne Trimaille<br>
<<a href="mailto:etienne.trimaille@gmail.com" target="_blank">etienne.trimaille@gmail.com</a>> wrote:<br>
><br>
> Not recommended because others already gave the qgis.utils.plugins dictionary, but you can do "from plugin_a.xxxx import yyy" from you plugin B.<br>
<br>
Actually I would recommend avoiding both the qgis.utils.plugins<br>
dictionary AND the from plugin.*** approach, UNLESS you maintain both<br>
plugins. Plugin API isn't guaranteed to be stable, and if your plugin<br>
relies on someone else's plugin to work then there's the risk that<br>
they'll refactor and change their plugin and break yours in turn.<br>
<br>
So unless you know that this won't happen, I would strongly suggest<br>
going via the processing route only.<br>
<br>
Nyall<br>
<br>
<br>
><br>
> Le ven. 23 avr. 2021 à 04:43, Tobias Schmetzer <<a href="mailto:tschmetzer@gmx.de" target="_blank">tschmetzer@gmx.de</a>> a écrit :<br>
>><br>
>> Hello Zac,<br>
>><br>
>> I just saw you were helped and I'm happy the functionality solved your problem!<br>
>><br>
>> If you feel there's a lack of documentation and you've got an idea how to improve it I think the best thing to do is to support this documentation with a contribution. This is how I started when I realised something was missing and I suggested to add this or that bit of information.<br>
>><br>
>> It's easy to sign up on GitHub and make a suggestion. You can't damage anything. Everything will get reviewed and maybe discussed. There's also guidelines in the docs how to contribute.<br>
>><br>
>> Best regards, Tobias<br>
>><br>
>> 22.04.2021 14:09:30 Zac Wang <<a href="mailto:zacwang15@gmail.com" target="_blank">zacwang15@gmail.com</a>>:<br>
>><br>
>> Hi guys,<br>
>><br>
>> Thank you for all your replies.<br>
>><br>
>> 'qgis.utils.plugins' really resolves my problem.<br>
>><br>
>> This issue obsessed me for a few days, and your advice is fantastic.<br>
>><br>
>> I can't understand why there is no documentation for such a useful functionality.<br>
>><br>
>> Anyway, thank you for your help. Appreciate it.<br>
>><br>
>><br>
>> Cheers,<br>
>><br>
>> Zac<br>
>><br>
>><br>
>> On Thu, 22 Apr 2021 at 22:01, Raymond Nijssen <<a href="mailto:r.nijssen@terglobo.nl" target="_blank">r.nijssen@terglobo.nl</a>> wrote:<br>
>>><br>
>>> Hi Zac,<br>
>>><br>
>>> You can use:<br>
>>><br>
>>> qgis.utils.plugins<br>
>>><br>
>>> to get a dictionary with all active plugins.<br>
>>><br>
>>><br>
>>><br>
>>> To find out if another plugin is available:<br>
>>><br>
>>> 'processing' in qgis.utils.plugins<br>
>>><br>
>>><br>
>>><br>
>>> And use it like:<br>
>>><br>
>>> processing_pl = qgis.utils.plugins['processing']<br>
>>> processing_pl.toolbox.searchBox.setText('overlay')<br>
>>><br>
>>><br>
>>> Hope this helps,<br>
>>><br>
>>> Raymond<br>
>>><br>
>>><br>
>>> On 22-04-2021 13:07, Zac Wang wrote:<br>
>>> > Hi all,<br>
>>> ><br>
>>> > Are there some ways to transfer data between different pyqgis plugins? I<br>
>>> > hope plugins share state.<br>
>>> ><br>
>>> > The only way I found is to make pluginA to be a child component of<br>
>>> > QgisApp(iface.mainWindow()).<br>
>>> ><br>
>>> > Then in another pluginB, call findChild() to get the object(pluginA) and<br>
>>> > connect its signal.<br>
>>> ><br>
>>> > This is a possible solution, but it's not easy to maintain because<br>
>>> > plugins are not initiated in the same file.<br>
>>> ><br>
>>> > Is there a better solution?<br>
>>> ><br>
>>> > Regards,<br>
>>> ><br>
>>> > Zac<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>
>>> > List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>>> > Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><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>
>>> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>>> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><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>
>> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><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>
>> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><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>
> List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
> Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div>