在win7上的PyQt中,在PyQtQicon.setThemeSearchPaths()中输入什么路径



正如文档中所写的那样,我想根据当前代码编辑setThemeSearchPaths()

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

打印出来:

C:/Python27/icons/
    :/icons/

没有找到图标。我想问你,在win7上的函数setThemeSearchPaths()中,我必须通过什么路径作为输入参数?

当我发现图标应该在路径/文件上:

C:Windowssystem32imageres.dll

但是,如果我输入.dll文件的路径,什么也不会发生?

Windows没有任何图标主题。Qt使用免费桌面图标规范。

使用默认路径,将图标主题提取到C:/Python27/icons/或将其嵌入为Qt资源。

你可以尝试下载Faenza图标。你最终应该得到这样的文件结构:

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

最新更新