Hi Asim,

I'm surprised that previous QGis versions should have returned three layers "Gasunie 2, Gasunie Z-509-05 and Wattinfra Kabelverbinding", because the legend image shows a single vector layer "Overzicht entities" with three classes, not three separate layers.

According to https://api.qgis.org/api/classQgsProject.html:

QgsProject.instance().mapLayers() => "Returns a map of all registered layers by layer ID."

Perhaps you previously had three separate layers bundled in a layer group?

Ludwig


Am 08.12.23 um 15:47 schrieb Asim al-sofi via QGIS-User:
Hi All,
I have a question related to printing out the shown layers in qgis.
I made a plugin that has worked fine in the older Qgis versions but not working properly in the new version. The problem that iam facing is that the *QgsProject.instance().mapLayers().values() *does not show me the layers shown in qgis. So in the previous version, the below image gives me the names of the layers *Gasunie 2, Gasunie Z-509-05 and Wattinfra Kabelverbinding*. But in the new Qgis version it gives me the names *Overzicht entities and openbasiskaart.nl <http://openbasiskaart.nl>*. Does anyone know how to tackle this problem?
Layers.png
Thanks in advance
Kind regards
Asim

_______________________________________________
QGIS-User mailing list
[email protected]
List info:https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe:https://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
QGIS-User mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to