Re: [Qgis-user] Check if a selectionChanged signal is connected to any slot?

2017-10-03 Thread Matthias Kuhn
Hi Mariane, I don't see the usage of Qt.UniqueConnection in your example. This works for me: def executeSel(): print('selection changed') layer.selectionChanged.connect(executeSel, Qt.UniqueConnection) layer.selectionChanged.connect(executeSel, Qt.UniqueConnection) Traceback (most

Re: [Qgis-user] Check if a selectionChanged signal is connected to any slot?

2017-10-03 Thread Tudorache, Marian
Hi Mathias, Yeah, this is what I knew in theory. Unfortunately this is not the case. You can try in python console. Make sure you have a layer with some features. Define function executeAfterSelection where you do some dummy printing. Call three times

Re: [Qgis-user] Check if a selectionChanged signal is connected to any slot?

2017-10-03 Thread Matthias Kuhn
Hi Marian, Just tell Qt that it shouldn't create the connection more than once using Qt::UniqueConnection. Cheers Matthias On 10/2/17 5:30 PM, Tudorache, Marian wrote: > > > > Hi everyone, > > > > I have connected the signal selectionChanged so some code, which is > executed after

Re: [Qgis-user] Check if a selectionChanged signal is connected to any slot?

2017-10-02 Thread Tudorache, Marian
Hi everyone, I have connected the signal selectionChanged so some code, which is executed after features are selected. myLayer.selectionChanged.connect(self.executeAfterSelection) Then I have a method self. executeAfterSelection(self, featuresIds) The SIGNAl/SLOT tandem works but now I