def __init__(self, iface): # Save reference to the QGIS interface self.iface = iface # Reference map canvas self.canvas = self.iface.mapCanvas() # Emit QgsPoint after each click on canvas self.clickTool = QgsMapToolEmitPoint(self.canvas) # initialize plugin directory self.plugin_dir = os.path.dirname(__file__) # initialize locale locale = QSettings().value("locale/userLocale")[0:2] localePath = os.path.join(self.plugin_dir, 'i18n', 'vector_selectbypoint_{}.qm'.format(locale)) if os.path.exists(localePath): self.translator = QTranslator() self.translator.load(localePath) if qVersion() > '4.3.3': QCoreApplication.installTranslator(self.translator) # Create the dialog (after translation) and keep reference self.dlg = vector_selectbypointDialog() # Create the GUI self.canvas.setMapTool( self.clickTool )
def __init__(self, iface): # On garde la reference a l'interface QGIS self.iface = iface # Reference au canvas de la carte self.canvas = self.iface.mapCanvas() # Notre click tool va emettre un QgsPoint a chaque clic self.clickTool = QgsMapToolEmitPoint(self.canvas) # creation de notre fenetre GUI self.dlg = vector_selectbypointDialog()
def __init__(self, iface): # Save reference to the QGIS interface self.iface = iface # refernce to map canvas self.canvas = self.iface.mapCanvas() # out click tool will emit a QgsPoint on every click self.clickTool = QgsMapToolEmitPoint(self.canvas) # create our GUI dialog self.dlg = vector_selectbypointDialog()
def run(self): # creer et montrer la fenetre de dialogue dlg = vector_selectbypointDialog() dlg.show() result = dlg.exec_() # Voir si OK a ete appuye if result == 1: # faire quelque chose d'interessant (supprimer la ligne avec pass # et y mettre votre propre code) pass
def run(self): # create and show the dialog dlg = vector_selectbypointDialog() # show the dialog dlg.show() result = dlg.exec_() # See if OK was pressed if result == 1: # do something useful (delete the line containing pass and # substitute with your code pass
def run(self): # make our clickTool the tool that we'll use for now self.canvas.setMapTool(self.clickTool) # create and show the dialog dlg = vector_selectbypointDialog() # show the dialog dlg.show() result = dlg.exec_() # See if OK was pressed if result == 1: # do something useful (delete the line containing pass and # substitute with your code pass
def run(self): # activer le clickTool self.canvas.setMapTool(self.clickTool) # creer la fenetre de dialogue dlg = vector_selectbypointDialog() # Montrer la fenetre de dialogue dlg.show() result = dlg.exec_() # Voir si OK a ete appuye if result == 1: # faire quelque chose d'interessant (supprimer la ligne avec pass # et y mettre votre propre code) pass
def __init__(self, iface): # Save reference to the QGIS interface self.iface = iface # refernce to map canvas self.canvas = self.iface.mapCanvas() # out click tool will emit a QgsPoint on every click self.clickTool = QgsMapToolEmitPoint(self.canvas) # create our GUI dialog self.dlg = vector_selectbypointDialog() # create a list to hold our selected feature ids self.selectList = [] # current layer ref (set in handleLayerChange) self.cLayer = None # current layer dataProvider ref (set in handleLayerChange) self.provider = None
def __init__(self, iface): # On garde la reference a l'interface QGIS self.iface = iface # Reference au canvas de la carte self.canvas = self.iface.mapCanvas() # Notre click tool va emettre un QgsPoint a chaque clic self.clickTool = QgsMapToolEmitPoint(self.canvas) # creation de notre fenetre GUI self.dlg = vector_selectbypointDialog() # creation d'une liste pour contenir nos ids des features selectionnees self.selectList = [] # reference a la couche courante (assigne dans handleLayerChange) self.cLayer = None # reference au dataProvider de la couche courante (assigne dans handleLayerChange) self.provider = None