From 4faaecc5deaa4cd2404fbbbd8e7ceaa3973c7854 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Fri, 5 Oct 2018 15:12:42 -0400 Subject: [PATCH] [QGIS3 API] QgsVectorLayer::setSelectedFeatures => select fix https://github.com/QGEP/QGEP/issues/446 --- src/gui/qgepprofiledockwidget.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/qgepprofiledockwidget.py b/src/gui/qgepprofiledockwidget.py index d5eb00ff..f945edeb 100644 --- a/src/gui/qgepprofiledockwidget.py +++ b/src/gui/qgepprofiledockwidget.py @@ -183,13 +183,13 @@ def onSelectCurrentPathAction(self): if filters: request.setFilterExpression(' OR '.join(filters)) features = catchment_areas_layer.getFeatures(request) - catchment_areas_layer.setSelectedFeatures([f.id() for f in features]) + catchment_areas_layer.select([f.id() for f in features]) if qgep_reach_layer: request = QgsFeatureRequest() request.setFilterExpression('obj_id IN ({})'.format(reach_list)) features = qgep_reach_layer.getFeatures(request) - qgep_reach_layer.setSelectedFeatures([f.id() for f in features]) + qgep_reach_layer.select([f.id() for f in features]) if wastewater_nodes_layer: request = QgsFeatureRequest() @@ -199,7 +199,7 @@ def onSelectCurrentPathAction(self): for feature in features: ids.append(feature.id()) wastewater_structures.append(feature['fk_wastewater_structure']) - wastewater_nodes_layer.setSelectedFeatures(ids) + wastewater_nodes_layer.select(ids) wastewater_structure_list = ','.join(("'" + id + "'" for id in wastewater_structures)) @@ -207,7 +207,7 @@ def onSelectCurrentPathAction(self): request = QgsFeatureRequest() request.setFilterExpression('obj_id IN ({})'.format(wastewater_structure_list)) features = qgep_wastewater_structures_layer.getFeatures(request) - qgep_wastewater_structures_layer.setSelectedFeatures([f.id() for f in features]) + qgep_wastewater_structures_layer.select([f.id() for f in features]) def setTree(self, nodes, edges): self.nodes = nodes