python - Functions get called more and more times with reopening plugin -


i have qgis plugin written in python 2.7.3 pyqt 4.9.1, qt 4.8.1. when run plugin every function works fine. when close window , reopen again, every function happens twice. close/open again , goes 3 times, etc., etc.

where should error here? def run(self) part looks this:

def run(self):      self.dlg.show()      self.availablelayers()      self.dlg.pushbutton_2.clicked.connect(self.openfile)      self.dlg.pushbutton.clicked.connect(self.groupby)      self.dlg.toolbutton_4.clicked.connect(self.togglerightpanel) 

if reload plugin clicking button "plugin builder", starts again one.

i should mention wouldn't lose view user created (the plugin table viewer), rather able close window, open , have again there without cells being cleared.

every time call connect, adds connection - if it's same slot. need move connections out of run() method , put them in setup method dialog, made once.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -