[Gfoss] Python itemData

NicoPez nico.pezzotta a gmail.com
Ven 1 Ago 2014 15:57:32 CEST


Ciao, in realtà la comboBox l'ho già popolata con questo codice:

    def chooseLayer(self): 
        layerList = []     # crea una lista vuota
        self.comboBox.clear()     # svuota la lista del combo box
        layerList = self.getLayerNames()     # a layerList assegna il
risultato della procedura getLayerNames()
        self.comboBox.addItems(layerList)
        self.FoglioLine.clear()
        self.ParticelLine.clear()
        self.OnSelectBoxClicked()
        return

    # Get the list of layers (list of names) in QgsMapLayerRegistry
    def getLayerNames(self):
        layermap = QgsMapLayerRegistry.instance().mapLayers()   
        layerLst = []
        for i, layer in layermap.iteritems():
            if layer.type() == QgsMapLayer.VectorLayer:    # considera solo
i layers vettoriali
                layerLst.append( unicode( layer.name() ) )   # prende il
nome di ogni layer a lo aggiunge alla lista layerLst
        return layerLst

nel frattempo sto cmq leggendo il la pagina che mi avete indicato :) Grazie



--
View this message in context: http://gfoss-geographic-free-and-open-source-software-italian-mailing.3056002.n2.nabble.com/Python-itemData-tp7589041p7589046.html
Sent from the Gfoss -- Geographic Free and Open Source Software - Italian mailing list mailing list archive at Nabble.com.


Maggiori informazioni sulla lista Gfoss