コード例 #1
0
    def __init__(self,iface):
        QtGui.QDialog.__init__(self)
        # Set up the user interface from QTDesigner.
        self.ui = Ui_spatial_dynamics() # read GUI 
	self.ui.setupUi(self)
        self.iface = iface
        self.dir = os.path.realpath(os.path.curdir)# Return the canonical path of the specified filename
	        
        self.layers = [] #set a empty list?(is it necessary steps?)
        for i in range(self.iface.mapCanvas().layerCount()):    #this for loop adds current layers
            layer = self.iface.mapCanvas().layer(i)             #to dropdown menu
            self.layers += [layer]
            if layer.type() ==layer.VectorLayer:
		self.ui.activecombobox.addItem(layer.name()) #set dynamic labels in the combobox
	    elif layer.type == layer.RasterLayer:
	    	pass
	    else:
		pass