[Qgis-developer] QGIS OSGEO4W Python Plugin Problem

Bob Bruce Bob.Bruce at shaw.ca
Wed Sep 2 15:46:37 EDT 2009


Previously I had posted the message shown below to the QGIS User List. I have not received any response from that group but hopefully someone here who is a developer will help....Since the time that I posted this message I set up my own Python Plugin Repositor and added it to the list. I received messages about this error from people who tried to use this plugin.I have done further research today and have found that this error does not occur for the standalone Windows installers for QGIS that I downloaded from the QGIS.org website (both 1.1 and 1.2 work fine). This error only happens with the OSGEO4W installers and only for the more recent installers. I suspect that it is some component that I am downloading that is causing it. I wonder if it could be the QT libraries that are available that I am selecting?Can you help unravel this problem?thanks,             Bob Bruce-----Original Message-----From: qgis-user-bounces at lists.osgeo.org [mailto:qgis-user-bounces at lists.osgeo.org] On Behalf Of Bob BruceSent: Wednesday, August 26, 2009 9:22 AMTo: QGIS User List; Bruce, Bob (CON)Subject: [Qgis-user] QGIS API QgsMapToolEmitPoint Is Not Working Now andQGIS CrashesSomething strange is happening, a plugin that was working before has stopped working for me now. I recently set up a new Windows XP system (which has been fully patched) and then installed QGIS 1.0, 1.1.0 and 1.2 along with the libraries using the OSGEO4W installer. It has been two months since I have been using this plugin but I don't suppose that the API has changed in that time?When I run my plugin in QGIS 1.1.0 (Pan) the Python code in the plugin enables the mouse clicks on the canvas to be captured and when I move the cursor on the mapcanvas I see a cross-hair cursor but as soon as I click on the canvas a Windows dialog appears with the message "qgis.exe has encountered a problem and needs to close" and QGIS crashes. The slot function never seems to be entered because the QMessageBox at the top of it never appears before the crash. Shown below is a snippet of my Python code in which I have added some calls to QMessageBox in the function setUpRubberBanding and these get called but the message box in setClipWindow never gets called before the crash.What would be causing this QGIS crash?thanks,             Bob Bruce     def setUpRubberBanding(self):         -         -         (ommitted code)         -         -         self.canvas = self.iface.mapCanvas()         QMessageBox.information(self,'ImageClipperDlg - ClipImage','In Function: setUpRubberBanding'+\         ' Map Canvas Scale = "' + str(self.canvas.scale()) + '"')         self.emitPoint = QgsMapToolEmitPoint(self.canvas)         self.canvas.setMapTool(self.emitPoint)         QMessageBox.information(self,'ImageClipperDlg - ClipImage','In Function: setUpRubberBanding'+\                                 ' about to connect signal "canvasClicked"')         QObject.connect(self.emitPoint, SIGNAL("canvasClicked(QgsPoint &, Qt::MouseButton)"), self.setClipWindow)         self.isEmittingPoint = True     def setClipWindow(self, point, button):         QMessageBox.information(self,'ImageClipperDlg - ClipImage','Entered Function: setClipWindow')


More information about the Qgis-developer mailing list