Connecting the actions
You might have noticed that none of the menu commands and toolbar icons do anything yet—even the Quit command doesn't work. Before our actions do anything, we have to connect them to the appropriate method. To do this, add the following to your MapExplorer.__init__()
method, immediately after the call to setupUi()
:
self.connect(self.actionQuit, SIGNAL("triggered()"), qApp.quit) self.connect(self.actionShowBasemapLayer, SIGNAL("triggered()"), self.showBasemapLayer) self.connect(self.actionShowLandmarkLayer, SIGNAL("triggered()"), self.showLandmarkLayer) self.connect(self.actionZoomIn, SIGNAL("triggered()"), self.zoomIn) self.connect(self.actionZoomOut, SIGNAL("triggered()"), self.zoomOut) self.connect(self.actionPan, SIGNAL("triggered()"), self.setPanMode) self.connect...