PyQt/PySide - icon display

前端 未结 5 850
温柔的废话
温柔的废话 2020-12-30 10:30

I have a PySide app which has an icon for the MainWindow (a QMainWindow instance). When I run the file normally, the icon is visible and everything

5条回答
  •  囚心锁ツ
    2020-12-30 11:18

    You must include "qico4.dll" manually in your release folder. Insert this in your setup.py:

    import sys
    from os.path import join, dirname
    from cx_Freeze import setup, Executable
    
    _ICO_DLL = join(dirname(sys.executable), 
                         'Lib', 'site-packages',
                         'PySide', 'plugins',
                         'imageformats', 'qico4.dll')
    
    build_exe = {
            'include_files': [(
                    _ICO_DLL,
                    join('imageformats', 'qico4.dll'))]}
    
    setup(name = "xxxxx",
          version = "1.0.0",
          ...
          options = { ...
                     'build_exe': build_exe
                      ...},
          ...)
    

提交回复
热议问题