What path to enter in PyQt QIcon.setThemeSearchPaths() in pyqt on win7?

怎甘沉沦 提交于 2019-12-11 13:05:10

问题


As is written in the docs I would like to edit setThemeSearchPaths() as from current code:

if __name__ == "__main__":
    app = QtGui.QApplication([])
    for path in QtGui.QIcon.themeSearchPaths():
        print "%s/%s" % (path, QtGui.QIcon.themeName())

it prints out:

C:/Python27/icons/
    :/icons/

And no icons are found. I would like to ask you what path do I have to pass as input argument in function setThemeSearchPaths() on win7?

As I found out the icons should be on path/file:

C:\Windows\system32\imageres.dll

But if I input a path to .dll file nothing happens?


回答1:


Windows doesn't have any icon themes. Qt uses freedesktop icon specification.

Using default paths, either extract your icon theme to C:/Python27/icons/ or embed it as a Qt resource.

You can try to download Faenza Icons. You should end up with file structure like:

icons/<theme name>/index.theme
icons/<theme name>/apps/
icons/<theme name>/actions/
...


来源:https://stackoverflow.com/questions/29392213/what-path-to-enter-in-pyqt-qicon-setthemesearchpaths-in-pyqt-on-win7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!