oFo
oFo

Reputation: 21

How to load resource by PyQt5 uic loadUi?

I am trying to load ui by PyQt5.uic.loadUi. The ui window can load and show correctly, but the resouce(image, icon) of the ui window can not be loaded, so the window can not display the image (background).

My folder structure is as following:

Project
    | app.py  (call loadUi)
    + UI    (folder)
       |  login.ui
       |   login.qrc
       + image
           | logo.png  (as backgroud of login ui)
           | close.ico  (close button icon)

the login window can not show the logo.png and close.ico

How can I solve this?

Upvotes: 0

Views: 15

Answers (0)

Related Questions