Hi Tim, On Thu, Apr 19, 2012 at 3:33 AM, Tim Sutton <[email protected]> wrote:
> Hi > > On Thu, Apr 19, 2012 at 11:28 AM, Tim Sutton <[email protected]> wrote: > > Hi > > > > On Thu, Apr 19, 2012 at 11:14 AM, Denis Rouzaud <[email protected]> > wrote: > >> I would try > >> SIGNAL("layersWillBeRemoved(QStringList)") > >> > > > > Oh but its not a string list that the signal is emitting but rather a > > QList of pointers to map layers? > > > > Oh sorry I see I was the source of confusion with my python snippet - > yes it is the added slot I am interested in. > Well, I'm no PyQt wizard, but did you try: Decorating your slot? @pyqtSlot(list) def getLayers(self, layers): do stuff Or maybe define it in the connection? (i.e. add [list]): QgsMapLayerRegistry.instance().layersWillBeRemoved[list].connect(self. getLayers) Seems QList should be auto-converted to Python list type anyhow by PyQt. Does the QgsMapLayerRegistry.instance() need assigned to a variable before making a connection? Another silly question: does getLayers() have enough parameters? > >> On 04/19/2012 11:09 AM, Tim Sutton wrote: > >> > >> Hi All > >> > >> Does anyone know the appropriate way to connect to the new > >> QgsMapLayerRegistry signal I added in python: > >> > >> void layersAdded( QList<QgsMapLayer *> theMapLayers ); > >> > >> I tried: > >> > >> QtCore.QObject.connect(QgsMapLayerRegistry.instance(), > >> > >> QtCore.SIGNAL('layersWillBeRemoved(QList<QgsMapLayer*>)'), > >> self.getLayers) > >> > >> But that doesnt seem to be hitting my slot. > >> > Regards, Larry Shaffer Dakota Cartography Black Hills, South Dakota
_______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
