[Qgis-developer] problem restarting plugin

Chang, Elizabeth Elizabeth.Chang at noblis.org
Wed Aug 12 09:52:40 EDT 2009


Hi,

 

I have a plugin that works fine the first time you run it. Then, when
you try to restart the plugin, I get this error: 

 

Traceback (most recent call last):

  File "C:/Documents and
Settings/m29308/.qgis//python/plugins\NoblisPostGISGraphs\NoblisPostGISG
raphs.py", line 42, in run

    QObject.connect(self.PostGISdialog, SIGNAL("Graph"), self.graph)

TypeError: argument 3 of QObject.connect() has an invalid type

 

Python version:

2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]

 

I can't figure out why it is complaining about argument 3-self.graph is
a method name and not only does it work the first time around, other
connections are also fine. The only difference is that self.graph takes
in a list.

 

In PostGISdialog

                @pyqtSignature("on_GraphButton_clicked()")

                def on_GraphButton_clicked(self):

                                tables=[]

                                for index in
xrange(self.GraphListWidget.count()):

 
tables.append(str(self.GraphListWidget.item(index).text()))

                                self.emit(SIGNAL("Graph(QStringList)"),
QStringList(tables))

 

 

in PostGISGraphs

                def run(self): 

                                QObject.connect(self.canvas,
SIGNAL("selectionChanged(QgsMapLayer*)"), self.selectionchanged)

                                flags = Qt.WindowTitleHint |
Qt.WindowSystemMenuHint | Qt.WindowMaximizeButtonHint     #
QgisGui.ModalDialogFlags

                                self.PostGISdialog=
PostGISdialog(self.iface.mainWindow(), flags)

                                QObject.connect(self.PostGISdialog,
SIGNAL("LoadScript(QString)"), self.loadscript)

                                QObject.connect(self.PostGISdialog,
SIGNAL("ExportScript(QString, QString)"), self.exportscript)

                                QObject.connect(self.PostGISdialog,
SIGNAL("Graph(QStringList)"),self.graph)

                                QObject.connect(self.PostGISdialog,
SIGNAL("Execute(QString)"), self.execute)

                                QObject.connect(self.PostGISdialog,
SIGNAL("SaveConn(QString)"), self.saveConnection)

                                QObject.connect(self.PostGISdialog,
SIGNAL("Connect(QString)"), self.establishConnection)

                                QObject.connect(self.PostGISdialog,
SIGNAL("Disconnect(QString)"), self.disconnectdb)

                                QObject.connect(self.PostGISdialog,
SIGNAL("GetTablesFromSchema(QString)"), self.populateTables)

                                self.PostGISdialog.show()

 

                def graph(self, tablesToGraph):

                                self.tablesToGraph=list(tablesToGraph)

 

Does anyone have any ideas? Thanks in advance.

 

 

 

 

 

Elizabeth Chang

Lead

Noblis

3150 Fairview Park Drive Sourth

Falls Church, VA 22042

703-610-2321 (office)

elizabeth.chang at noblis.org

*************************************

Noblis

For the best of reasons

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20090812/02f07109/attachment-0001.html


More information about the Qgis-developer mailing list