Fwd: PyQt6 and SIP v6 Snapshots Available

Maurizio Berti maurizio.berti at gmail.com
Sat Sep 26 19:10:53 BST 2020


>
> Why use the Qt resource system at all?
>

Well, all considering, right now it's just about laziness ("if it works,
don't fix it") ;-)

All my source resource files are located in a different folder, which is a
parent of the actual main script, as I wanted to keep the project structure
clean, with only python files within the main script folder (and, since the
pyrcc compiled file is a single python file, I was fine with that): I've
written a script that recreates the whole rcc and calls pyrcc to generate
the python file in the main script folder, so right now I only have the
import in the main script and everything is done using
whateverLoads(':/path/resource'), but there are some cases for which the
loading is dynamic and I'm just afraid I'll not be completely sure I'll be
able to catch all occurrences in my code.
But, I get the point: even with cx_freeze I still get lots of files, so
adding the resources as single files won't change that much, and I'll only
need to get used to the fact that I'll also have the resource directories
there.


> If that won't be available, will setThemeSearchPaths work
> > anyway?
>
> Of course. Nothing in Qt forces you to use a resource rather than a
> regular file.
>

Ok, I've tested it (I don't know why I didn't think about that before...)
and it obviously works...



> > Will all other ":/" resource loading keep their functionalities
> > when using local relative paths (or importlib.resources)?
>
> Sorry, I don't understand the question. Obviously Qt knows nothing about
> importlib.resources.
>

Sorry, I never used importlib.resources before and for some reason I
misunderstood everything about that.

Thank you,
Maurizio

-- 
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20200926/f5a16398/attachment.htm>


More information about the PyQt mailing list