[QGIS-Developer] QGIS error when connected to signal newProjectCreated

Stefan Keller sfkeller at gmail.com
Mon Oct 16 08:38:47 PDT 2017


Hi Richard,

Many thanks for engaging here.
It seems, that the error is issued by another signal which we
connected at start/reload of the plugin, but forgot to disconnect.

:Stefan


2017-10-13 11:24 GMT+02:00 Richard Duivenvoorde <rdmailings at duif.net>:
> Can you show some more code, and in what version of QGIS?
>
> If I run the following in the python console (2.18.13 and master), it
> just works?:
>
> def test():
>     print('yes')
>
> iface.newProjectCreated.connect(test)
>
> Regards,
>
> Richard Duivenvoorde
>
>
> On 13-10-17 11:12, Stefan Keller wrote:
>> This message was sent by Martin Boos (but seems to have been rejected
>> currently):
>>
>> Hi devs
>>
>> I’m trying to handle the signal ‘newProjectCreated’ in my python
>> plugin. Unfortunately, every time this event occurs, a python error is
>> thrown:
>>
>> Traceback (most recent call last):
>> File "C:/Users/Martin/.qgis2/python/plugins\Vector-Tiles-Reader-QGIS-Plugin\vtr_plugin.py",
>> line 88, in _on_new_qgis_project_created
>> pass
>> TypeError: 'NoneType' object is not callable
>>
>> Funny thing is, this happens even if my handler is empty:
>>
>>     def _on_new_qgis_project_created(self):
>>         pass
>>
>>
>> Any ideas how to solve this?
>>
>> Thanks and best regards
>> Martin
>> _______________________________________________
>> QGIS-Developer mailing list
>> QGIS-Developer at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the QGIS-Developer mailing list