i'm making some experiments with the SelectionChanged signal of a QgsVectorLayer.
i try this piece of code :
curLayer.selectionChanged.connect(self.test)
and "test" print a warning message.
The probleme i have is that the signal is triggered every time i click on the layer, even when there's no change of selection ...
Is there something i'm missing in this SelectionChanged behaviour ?
Thanks for your help.
Answer
Ok then, after a few searches :
U got to use the two lists provided by the SelectionChanged signal :
QgsFeatureIds selected,QgsFeatureIds deselected (as mentionned in the API doc...)
to check what is really changing in your selection, of course multiple features selection is to take in account ...
No comments:
Post a Comment