Master PyQt5 part 8: Using Qt Resource files

preview_player
Показать описание
Author Alan D Moore shows you how to deal with file paths in your applications using Qt Resources files and other tricks.

Thanks for watching!
Рекомендации по теме
Комментарии
Автор

Is it possible to list what resources are available? I mean I know whats in the resource file but I want to know if I can see that list from inside the code. Like listing all the files in a directory..

freecode.ai-
Автор

As always awesome explanation. Thanks for taking the time for creating such an informative video.

Unfortunately if you are using the QT Designer to generate the UI (I am lazy), then one needs to create the linkages for Qpixmap and icons directly in the designer. Else as you have mentioned in your previous videos this inofrmation would be lost during reworks of the GUI
Fortunately, the rc file can be created, edited and maintained in QT Designer. For normal elements (not buttons) the linkage can be made under Qlabel --> pixmap. For buttons, Maintittle etc. one has to select an icon (.ico file). This can generated online from png's with realtive ease.
All this inofrmation ofcourse can be stored in the rc file which need to be compiled with pyside6-rcc (6 or higher as pyrcc5 is not supported)

DA_CSF
Автор

In the playlist for PyQT prgogramming you are missing Part 7, it's in the Mastering PtQT playlist.

rwbazillion
Автор

instead of using just images in resource file can i add other python files that i also need to access?

jond
Автор

I used the designer and created a resource file through there, then when i convert the UI file it has a this line at the end "#import resources_rc" which throws an error. what do i do with it?

Darth_Pro_x
Автор

after i convert the qrc file to resource.py, i always get error no module named resource.

anonjohnnyG