<div dir="ltr">Hi All, <div><br></div><div>I'd like to add a "Set Group Icon..." action to the context menu for groups in the layer tree. I'm preparing a pull request for that.</div><div><br></div><div style>Everything is working fine, but I have a doubt on how to make the QGIS project to store the QIcon (location), so that when the project is open again, the QIcon can be constructed properly.</div><div style><br></div><div style>My first attempt was to store the QIcon path in the project, which works fine when the icon is set through QGIS GUI. However, it wouldn't work for PyQGIS users, who pass a QIcon object to the setIcon() method of QgsLayerTreeGroup. Since QIcon does not store its image file path, it would not be possible to access the path and store it in the project file. I would have to force PyQGIS users to set the image file path via get/set functions iconPath()-setIconPath(), which is not very elegant, but it's the only solution I see.</div><div style><br></div><div style>Do you know any other solution for this problem? Perhaps something about storing the QIcon somehow serialized? </div><div style><br></div><div>Regards, </div><div><br></div><div>Germán Carrillo<br>-- <br><div>-----------<br>  |\__  <br>(:>__)(<br>   |/    <br>Soluciones Geoinformáticas Libres                            <br><a href="http://geotux.tuxfamily.org/" target="_blank">http://geotux.tuxfamily.org/</a><br><a href="http://twitter.com/GeoTux2" target="_blank">http://twitter.com/GeoTux2</a><br></div>
</div></div>