[QGIS-Developer] Creating & loading Qt6 resource files for python plugins

DelazJ delazj at gmail.com
Thu Jan 8 02:58:55 PST 2026


Hi Benjamin,
using rcc command (available in qt6-devel in OSGeo4w) should do the trick.
See
https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/plugins/plugins.html#resource-file
or
https://stackoverflow.com/questions/66099225/how-can-resources-be-provided-in-pyqt6-which-has-no-pyrcc

Greetings,
Harrissou

Le jeu. 8 janv. 2026 à 11:43, Benjamin Jakimow via QGIS-Developer <
qgis-developer at lists.osgeo.org> a écrit :

> Dear Experts,
>
> for our QGIS Python plugins we load icons into the Qt Resource system,
> so that they can be accessed as in QIcon(r':/myplugin/myicon.svg').
>
> In PyQt5 / QGIS3 we do this by:
> 1. compiling myresource.qrc files into a myresource_rc.py file, either
> using pyrcc5 (on CLI) or qgis.PyQt.pyrcc_main (in Python).
> 2. loading these icons on plugin start-up, like in:
>
>    import myresource_rc
>    myresource_rc.qInitResources()
>
> It seems that in QGIS4 / Qt6 neither pyrcc5 nor qgis.PyQt.pyrcc_main is
> available (tested in OSGeo4W qgis-qt6 environment).
>
> It's possible to create *_rc.py files using pyside6-rcc, but they use
> from PySide6 import QtCore
> which is not available (e.g. in the current OSGeo4W qgis-qt6 environment).
>
> Does anyone have an idea how we can create Qt6-style *._rc.py files
> instead?
>
> Greetings, Benjamin
>
>
>
> On 08.01.26 09:41, Valentin Buira via QGIS-Developer wrote:
> > Hi devs, and happy new year to you all!
> >
> > I just posted a new QEP about introducing a data viewer in the model
> > designer canvas from the. Please see: https://github.com/qgis/QGIS-
> > Enhancement-Proposals/pull/359 <https://github.com/qgis/QGIS-
> > Enhancement-Proposals/pull/359>
> >
> > This QEP aims to bring an integrated data viewer directly inside the
> > model designer to inspect and debug the state of your model as you build
> > them.
> >
> > Thanks for any feedback and cheers,
> > Valentin
> >
> > _______________________________________________
> > 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
>
> --
> Dr. Benjamin Jakimow
> Earth Observation Lab | Geography Department | Humboldt-Universität zu
> Berlin
>
> e-mail: benjamin.jakimow at geo.hu-berlin.de
>
> phone:  +49 (0) 30 2093 45846
> mobile: +49 (0) 157 5656 8477
>
> mail:   Unter den Linden 6 | 10099 Berlin | Germany
> matrix: @jakimowb:hu-berlin.de
> web:    https://eolab.geographie.hu-berlin.de/
>
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20260108/3b1c44d3/attachment.htm>


More information about the QGIS-Developer mailing list