I'm using QlistView to show my names of departement in the studied area after using the 'extract by location' processus:
# res=QgsVectorLayer()
# capture département inside the studied area :
res = processing.runalg('qgis:extractbylocation', departementLayer, layerZone, u'intersects', 0, None)
# Créer une couche vector issue de l'extraction des départements dans la zone
departementLayer = QgsVectorLayer(res['OUTPUT'], "Departement(s) dans la zone d'etude","ogr")
features = ObjectifVilleExtract.departementLayer.getFeatures()
model3 = QStandardItemModel()
for feature in features:
item = QStandardItem(feature['name_dept'])
item.setCheckable(True)
.model3.appendRow(item)
self.dlg.listView.setModel(.model3)
Now I would like to show the code for each departement . I know that I can't use "listview" but I have to use 'Qtableview'. How can I do that?