Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

legendLayersAdded signal not fired anymore in master? #50718

Closed
2 tasks done
rduivenvoorde opened this issue Oct 27, 2022 · 1 comment · Fixed by #50731
Closed
2 tasks done

legendLayersAdded signal not fired anymore in master? #50718

rduivenvoorde opened this issue Oct 27, 2022 · 1 comment · Fixed by #50731
Labels
API Break! Breaks stable API. Proceed with extreme caution!! Bug Either a bug report, or a bug fix. Let's hope for the latter! PyQGIS Related to the PyQGIS API

Comments

@rduivenvoorde
Copy link
Contributor

What is the bug or the crash?

Hi, having a plugin which uses the legendLayersAdded signal:
https://qgis.org/pyqgis/master/core/QgsProject.html?#qgis.core.QgsProject.legendLayersAdded

I found that current master (only) it is not fired anymore (while in 3.28 and older it is)

Steps to reproduce the issue

  • open QGIS
  • open Python console
  • run following lines of code
QgsProject.instance().legendLayersAdded.connect(lambda: print('legendLayersAdded fired'))
QgsProject.instance().layerWasAdded.connect(lambda: print('layerWasAdded fired'))

Now drag/drop a shpfile/geojson whatever onto the mapcanvas.

In 3.28 I see:

layerWasAdded fired
legendLayersAdded fired

but in master only:

layerWasAdded fired

Anybody can confirm?

Versions

QGIS version 3.29.0-Master QGIS code revision f287357
Qt version 5.15.4
Python version 3.10.7
GDAL/OGR version 3.5.2
PROJ version 9.1.0
EPSG Registry database version v10.074 (2022-08-01)
GEOS version 3.11.0-CAPI-1.17.0
SQLite version 3.39.4
PostgreSQL client version unknown
SpatiaLite version 5.0.1
QWT version 6.1.4
QScintilla2 version 2.11.6
OS version Debian GNU/Linux bookworm/sid
       
This copy of QGIS writes debugging output.

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

  • I tried with a new QGIS profile

Additional context

No response

@rduivenvoorde rduivenvoorde added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Oct 27, 2022
@nicogodet nicogodet added the PyQGIS Related to the PyQGIS API label Oct 27, 2022
@rduivenvoorde rduivenvoorde added the API Break! Breaks stable API. Proceed with extreme caution!! label Oct 28, 2022
@rduivenvoorde
Copy link
Contributor Author

Ok, after some trial and error with recent commit, I think this commit 43d9fac accidently removed the signal.
Or at least, compiling that commit it is gone :-)

@nirvn is it possible that we dropped the signal somewhere? Cannot see something removed, but maybe it should be fired again somewhere?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Break! Breaks stable API. Proceed with extreme caution!! Bug Either a bug report, or a bug fix. Let's hope for the latter! PyQGIS Related to the PyQGIS API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants