PYQT4 - How do I compile and import a qrc file into my program?

前端 未结 5 1210
余生分开走
余生分开走 2021-02-01 23:05

I\'m having trouble importing a resource file. I\'m using pyqt4 with monkey studio and I am trying to import a png image. When I run the program I get an import error like

5条回答
  •  青春惊慌失措
    2021-02-01 23:54

    There really isn't much to explain here, you have a resource file (e.g. icon.qrc), then you call pyrcc4 -o icon_rc.py icon.qrc which will create a module icon_rc.py which you then can import in your project.

    It's all documented here.

提交回复
热议问题