1

via startup.py it is possible to execute python code when qgis starts.

Now I wonder, whether it is possible to set variable values, eg. a string variable which holds a path or a dictionary of values, which could be used by several plugins?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
  • Hi, i think there must be several ways to achieve that ... if u're using Windows u can work with environnement variables that can be set and accessed by your python code ... – Snaileater Aug 24 '15 at 08:42

1 Answers1

3

You have to get acces to an instance of that plugin:

from qgis.utils import plugins
instance = plugins['plugin_name']

Then if you want to use some widgets from main window ex.:

value = instance.dlg.comboBox.currentText()

If you define a variable under __init__, you can use it with:

variable = instance.variable_name
dmh126
  • 6,732
  • 2
  • 21
  • 36