<div dir="ltr">Hi Etienne,<div><br></div><div>Yes, you're right. I mean Python code.</div><div><br></div><div>Others' suggestions solved my problem. But it's good to know that I can call another plugin using the Processing package. </div><div><br></div><div>Thank you.</div><div><br></div><div><br></div><div>Cheers,</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 13:08, Etienne Trimaille <<a href="mailto:etienne.trimaille@gmail.com">etienne.trimaille@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"><div dir="ltr"><div>It also depends what you mean by "transferring data". It seems that you mean Python code ? Not geospatial data ?</div><div>If you mean Python code, you can also have a look at the Processing framework. <a href="https://docs.qgis.org/3.16/en/docs/user_manual/processing/index.html" target="_blank">https://docs.qgis.org/3.16/en/docs/user_manual/processing/index.html</a></div><div>You can call Processing algorithm plugin A from plugin B by using "processing.run("plugin_a_provider:name_of_algorithm")".</div><div><br></div><div>This will make you code available from the Processing graphical toolbox, Modeler, etc as well.<br></div><div><br></div><div>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></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 23 avr. 2021 à 04:43, Tobias Schmetzer <<a href="mailto:tschmetzer@gmx.de" target="_blank">tschmetzer@gmx.de</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div> <span style="font-family:sans-serif">Hello Zac, </span>
<br>
<br> <span style="font-family:sans-serif">I just saw you were helped and I'm happy the functionality solved your problem!</span>
<br>
<br> <span style="font-family:sans-serif">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. </span>
<br>
<br> <span style="font-family:sans-serif">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. </span>
<br>
<br> <span style="font-family:sans-serif">Best regards, Tobias</span>
<br>
<div>
<br>
<p>22.04.2021 14:09:30 Zac Wang <<a href="mailto:zacwang15@gmail.com" target="_blank">zacwang15@gmail.com</a>>:</p>
<blockquote>
<div dir="ltr">
Hi guys,
<div>
<br>
</div>
<div>
Thank you for all your replies.
</div>
<div>
<br>
</div>
<div> <span style="color:rgb(36,41,46);white-space:pre-wrap;font-size:12px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;box-sizing:border-box">'qgis</span><span style="color:rgb(36,41,46);white-space:pre-wrap;font-size:12px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace">.</span><span style="color:rgb(36,41,46);white-space:pre-wrap;font-size:12px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;box-sizing:border-box">utils</span><span style="color:rgb(36,41,46);white-space:pre-wrap;font-size:12px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace">.</span><span style="color:rgb(36,41,46);white-space:pre-wrap;font-size:12px;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;box-sizing:border-box">plugins' </span>really resolves my problem.
<br>
</div>
<div>
<br>
</div>
<div>
This issue obsessed me for a few days, and your advice is fantastic.
</div>
<div>
<br>
</div>
<div>
I can't understand why there is no documentation for such a useful functionality.
</div>
<div>
<br>
</div>
<div>
Anyway, thank you for your help. Appreciate it.
</div>
<div>
<br>
</div>
<div>
<br>
</div>
<div>
Cheers,
</div>
<div>
<br>
</div>
<div>
Zac
</div>
<div>
<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">
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>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
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>
</blockquote>
</div>
<div>
_______________________________________________
<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" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
<br>Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
<br>
</div>
</blockquote>
</div>
</div>
_______________________________________________<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>
</blockquote></div>