Skip to content

Commit

Permalink
[QGIS3 API] QgsVectorLayer::setSelectedFeatures => select
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids authored Oct 5, 2018
1 parent b823aa1 commit 4faaecc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gui/qgepprofiledockwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -199,15 +199,15 @@ 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))

if qgep_wastewater_structures_layer:
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
Expand Down

0 comments on commit 4faaecc

Please sign in to comment.