Hi Tim,<br><br><div class="gmail_quote">On Thu, Apr 19, 2012 at 3:33 AM, Tim Sutton <span dir="ltr"><<a href="mailto:lists@linfiniti.com">lists@linfiniti.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi<br>
<br>
On Thu, Apr 19, 2012 at 11:28 AM, Tim Sutton <<a href="mailto:lists@linfiniti.com">lists@linfiniti.com</a>> wrote:<br>
> Hi<br>
><br>
> On Thu, Apr 19, 2012 at 11:14 AM, Denis Rouzaud <<a href="mailto:denis.rouzaud@gmail.com">denis.rouzaud@gmail.com</a>> wrote:<br>
>> I would try<br>
>> SIGNAL("layersWillBeRemoved(QStringList)")<br>
>><br>
><br>
> Oh but its not a string list that the signal is emitting but rather a<br>
> QList of pointers to map layers?<br>
><br>
<br>
Oh sorry I see I was the source of confusion with my python snippet -<br>
yes it is the added slot I am interested in.<br></blockquote><div><br>Well, I'm no PyQt wizard, but did you try:<br><br>Decorating your slot?<br><br> @pyqtSlot(list)<br> def getLayers(self, layers):<br> do stuff<br>
<br><br>Or maybe define it in the connection? (i.e. add [list]):<br><br><span> QgsMapLayerRegistry.instance().</span><span>layersWillBeRemoved</span><span>[list].connect(self.</span><span>getLayers)</span><br><br>Seems QList should be auto-converted to Python list type anyhow by PyQt.<br>
<br><br>Does the <span>QgsMapLayerRegistry.instance() need assigned to a variable before making a connection?</span><br><br>Another silly question: does getLayers() have enough parameters?<br><br> </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
>> On 04/19/2012 11:09 AM, Tim Sutton wrote:<br>
>><br>
>> Hi All<br>
>><br>
>> Does anyone know the appropriate way to connect to the new<br>
>> QgsMapLayerRegistry signal I added in python:<br>
>><br>
>> void layersAdded( QList<QgsMapLayer *> theMapLayers );<br>
>><br>
>> I tried:<br>
>><br>
>> QtCore.QObject.connect(QgsMapLayerRegistry.instance(),<br>
>><br>
>> QtCore.SIGNAL('layersWillBeRemoved(QList<QgsMapLayer*>)'),<br>
>> self.getLayers)<br>
>><br>
>> But that doesnt seem to be hitting my slot.<br>
>><br></blockquote><div><br>Regards,<br><br>Larry Shaffer<br>Dakota Cartography<br>Black Hills, South Dakota <br></div></div><br>