示例#1
0
 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)
示例#2
0
 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)
示例#3
0
 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)
示例#4
0
 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)
示例#5
0
 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)
示例#7
0
 def getSelectedLayer(self):
     idx = self.dialog.comboBoxLayers.currentIndex()
     layerId = self.tempLayerIndexToId[idx]
     return qgs.getLayerFromId(layerId)
 def getSelectedLayer(self):
     idx = self.dialog.comboBoxLayers.currentIndex()
     layerId = self.tempLayerIndexToId[idx]
     return qgs.getLayerFromId(layerId)