[PyQt] How do you include the pyrcc5 -generated .py file into your app?

Phil Thompson phil at riverbankcomputing.com
Sun May 5 09:44:59 BST 2019


On 04/05/2019 22:33, Luna Tuna wrote:
> Ok, thanks.
> 
> Tried that, also tried including from .qrc the .ico within Qt Creator, 
> on
> the main window.  Doesn't work.
> 
> Also tried QIcon(":/images/app_icon.ico") trick and doesn't work.  With 
> or
> without importing the pyrcc5 generated file.
> 
> The only thing that seems to work is QIcon("ui/images/app_icon.ico"), 
> ie
> direct from image file.
> 
> It might mean I have to include the icons in a folder next to EXE, but 
> I'm
> okay with that.
> 
> Any idea why the resource is not including though?  I followed 
> instructions
> to the T.

Obviously not.

Look at the examples in the PyQt5 source package.

If you still have problems then post a short, complete example that 
demonstrates the problem.

Phil


More information about the PyQt mailing list