Hi Tim,<br><br><div class="gmail_quote">On Thu, Apr 19, 2012 at 3:33 AM, Tim Sutton <span dir="ltr">&lt;<a href="mailto:lists@linfiniti.com">lists@linfiniti.com</a>&gt;</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 &lt;<a href="mailto:lists@linfiniti.com">lists@linfiniti.com</a>&gt; wrote:<br>
&gt; Hi<br>
&gt;<br>
&gt; On Thu, Apr 19, 2012 at 11:14 AM, Denis Rouzaud &lt;<a href="mailto:denis.rouzaud@gmail.com">denis.rouzaud@gmail.com</a>&gt; wrote:<br>
&gt;&gt; I would try<br>
&gt;&gt; SIGNAL(&quot;layersWillBeRemoved(QStringList)&quot;)<br>
&gt;&gt;<br>
&gt;<br>
&gt; Oh but its not a string list that the signal is emitting but rather a<br>
&gt; QList of pointers to map layers?<br>
&gt;<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&#39;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">
&gt;&gt; On 04/19/2012 11:09 AM, Tim Sutton wrote:<br>
&gt;&gt;<br>
&gt;&gt; Hi All<br>
&gt;&gt;<br>
&gt;&gt; Does anyone know the appropriate way to connect to the new<br>
&gt;&gt; QgsMapLayerRegistry signal I added in python:<br>
&gt;&gt;<br>
&gt;&gt; void layersAdded( QList&lt;QgsMapLayer *&gt; theMapLayers );<br>
&gt;&gt;<br>
&gt;&gt; I tried:<br>
&gt;&gt;<br>
&gt;&gt;             QtCore.QObject.connect(QgsMapLayerRegistry.instance(),<br>
&gt;&gt;<br>
&gt;&gt; QtCore.SIGNAL(&#39;layersWillBeRemoved(QList&lt;QgsMapLayer*&gt;)&#39;),<br>
&gt;&gt;                     self.getLayers)<br>
&gt;&gt;<br>
&gt;&gt; But that doesnt seem to be hitting my slot.<br>
&gt;&gt;<br></blockquote><div><br>Regards,<br><br>Larry Shaffer<br>Dakota Cartography<br>Black Hills, South Dakota <br></div></div><br>