def repaintJoined(self): layerIdsToRefresh = qgs.getAllJoinedLayers( set(map(lambda x: x.layer.id(), self.model.getActiveVectors()))) # info("to refresh {}".format(layerIdsToRefresh)) layersToRefresh = map(lambda x: qgs.getLayerFromId(x), layerIdsToRefresh) map(lambda x: x.triggerRepaint(), layersToRefresh)
def masterUpdated(self, idx): layer = qgis_utils.getLayerFromId(self.comboBox_master.itemData(idx)) if layer is None: return self.master = layer attributes = layer.fields() self.updateComboBoxFromLayerAttributes( self.comboBox_master_key, attributes) # update layer in expressions for exp in self.exps: text = exp.currentText() exp.setLayer(layer) exp.setField(text)
def slaveUpdated(self, idx): layer = qgis_utils.getLayerFromId(self.comboBox_slave.itemData(idx)) if layer is None: return self.slave = layer attributes = layer.fields() self.updateComboBoxFromLayerAttributes( self.comboBox_slave_key, attributes) # update sheet name suggestion try: wb = open_workbook(layer.publicSource()) self.lineEdit_sheetName.setText(wb.sheet_names()[0]) except XLRDError: pass # update fields in comboboxes for combo in self.combos: self.updateComboBoxFromLayerAttributes(combo, attributes)
def repaintJoined(self): layerIdsToRefresh = qgs.getAllJoinedLayers(set(map(lambda x:x.layer.id(),self.model.getActiveVectors()))) #info("to refresh {}".format(layerIdsToRefresh)) layersToRefresh = map(lambda x: qgs.getLayerFromId(x), layerIdsToRefresh) map(lambda x: x.triggerRepaint(), layersToRefresh)
def getSelectedLayer(self): idx = self.dialog.comboBoxLayers.currentIndex() layerId = self.tempLayerIndexToId[idx] return qgs.getLayerFromId(layerId)