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

Benjamin Jakimow benjamin.jakimow at geo.hu-berlin.de
Thu Jan 8 02:35:46 PST 2026


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/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4284 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20260108/fc4d6556/attachment-0001.bin>


More information about the QGIS-Developer mailing list