<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Asim,</p>
<p>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.</p>
<p>According to <a class="moz-txt-link-freetext" href="https://api.qgis.org/api/classQgsProject.html">https://api.qgis.org/api/classQgsProject.html</a>:</p>
<p>QgsProject.instance().mapLayers() => "Returns a map of all
registered layers by layer ID."</p>
<p>Perhaps you previously had three separate layers bundled in a
layer group?</p>
<p>Ludwig</p>
<p><br>
</p>
<div class="moz-cite-prefix">Am 08.12.23 um 15:47 schrieb Asim
al-sofi via QGIS-User:<br>
</div>
<blockquote type="cite"
cite="mid:CANUs6XAbqt-sNukCUaivQDQP9gSTe+-DWXquVVwYbK3dc8cDJA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Hi All,
<div>I have a question related to printing out the shown
layers in qgis.</div>
<div>I made a plugin that has worked fine in the older
Qgis versions but not working properly in the new
version.</div>
<div>The problem that iam facing is that the <b>QgsProject.instance().mapLayers().values()
</b>does not show me the layers shown in qgis.</div>
<div>So in the previous version, the below image gives
me the names of the layers <b>Gasunie 2, Gasunie
Z-509-05 and Wattinfra Kabelverbinding</b>. But in
the new Qgis version it gives me the names <b>Overzicht
entities and <a href="http://openbasiskaart.nl"
moz-do-not-send="true">openbasiskaart.nl</a></b>.
Does anyone know how to tackle this problem?</div>
<div><img
src="cid:part1.uatBl60W.b5N6w064@kni-online.de"
alt="Layers.png" class="" width="316" height="199"><br>
</div>
<div>Thanks in advance</div>
<div>Kind regards</div>
<div>Asim</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
QGIS-User mailing list
<a class="moz-txt-link-abbreviated" href="mailto:QGIS-User@lists.osgeo.org">QGIS-User@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
</blockquote>
</body>
</html>