Hi All,

there seems to be an issue connecting the SIGNAL layersRemoved from
QgsMapLayerRegistry.

For example, if I save this script to a file, and run it from the Linux
terminal:

################################################
import unittest
from qgis.core import QgsApplication, QgsMapLayerRegistry

class SIGNALTest( unittest.TestCase ):

    def setUp( self ):
        app = QgsApplication([], True)
        QgsApplication.setPrefixPath("/usr", True)
        QgsApplication.initQgis()

        QgsMapLayerRegistry.instance().layersRemoved.connect(
self.myFunction )

    def myFunction( self, layerIds ):
        print "Called!"

    def test1( self ):
        self.assertEqual(1,1)

    def tearDown( self ):
        QgsApplication.exitQgis()

if __name__ == "__main__":
    unittest.main()
################################################

I get the following result:

##########
Called!
.
----------------------------------------------------------------------
Ran 1 test in 0.119s

OK
Segmentation fault
###########

If, on the contrary, I comment out the line where the connection is set or
if I use other signals such as layerRemoved or layersAdded instead of
layersRemoved, I get:

###########
.
----------------------------------------------------------------------
Ran 1 test in 0.111s

OK
###########

I'm using QGIS 2.14.2 on a GNU/Linux machine.

Can you confirm such problem? Do you have any clue about it?


Regards,

Germán

-- 
-----------
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres
http://geotux.tuxfamily.org/
http://twitter.com/GeoTux2
http://about.me/germancarrillo

<http://gis.stackexchange.com/users/4972/germ%c3%a1n-carrillo>
_______________________________________________
Qgis-developer mailing list
[email protected]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to