How to use Qgis ComboManger inside my plugin?

المشرف العام

Administrator
طاقم الإدارة
Could someone provide some detailed instructions (for very new beginners!!) on how to integrate combomanager in another plugin?

What I have tried (maybe wrong way of doing it!!...):
First I downloaded Qgis Combo Manager from [http://3nids.github.io/qgiscombomanager/] and extracted the zip folder.

Then I copiedcomposercombo.py, expressionfieldcombo.py, fieldcombo.py, layercombo.py and optiondictionary.py in my class directory.Then I included in the import section of my module' s python filethe following:

from qgis.core import *from layercombo import VectorLayerCombo, LayerCombofrom fieldcombo import FieldCombofrom expressionfieldcombo import ExpressionFieldComboFinally, under run(self)

line186 def run(self)line187 self.dlg.comboBox = VectorLayerCombo(self.dlg.comboBox)line188 self.dlg.comboBox_2 = FieldCombo(self.dlg.comboBox_2, self.dlg.comboBox)So when I run my plugin for the first time it works. Then, if I run it again just after the first time I get this error message:


Traceback (most recent call last):
File "C:/Users/Eleftheria/.qgis2/python/plugins\MyClass\my_module.py",
line 188, in run
self.dlg.comboBox = VectorLayerCombo(self.dlg.comboBox)
File "C:/Users/Eleftheria/.qgis2/python/plugins\MyClass\layercombo.py",
line 187, in init
LayerCombo.init(self, widget, initLayer, options, QgsMapLayer.VectorLayer) File "C:/Users/Eleftheria/.qgis2/python/plugins\MyClass\layercombo.py",
line 62, in init
self.widget.currentIndexChanged.connect(self.__currentIndexChanged)
AttributeError: 'VectorLayerCombo' object has no attribute 'currentIndexChanged'
Python

أكثر...
 
أعلى