在win7上pyqt的PyQt QIcon.setThemeSearchPaths()中输入什么路径? [英] What path to enter in PyQt QIcon.setThemeSearchPaths() in pyqt on win7?
问题描述
如docs中所写,我想编辑setThemeSearchPaths()
来自当前代码:
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())
打印出来:
C:/Python27/icons/
:/icons/
并且没有找到任何图标.我想问你我必须在win7上的函数setThemeSearchPaths()
中作为输入参数传递什么路径?
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
但是如果我输入了 .dll
文件的路径,什么都不会发生?
But if I input a path to .dll
file nothing happens?
推荐答案
Windows 没有任何图标主题.Qt 使用 freedesktop 图标规范.
Windows doesn't have any icon themes. Qt uses freedesktop icon specification.
使用默认路径,将您的图标主题提取到 C:/Python27/icons/
或将其嵌入为 Qt 资源.
Using default paths, either extract your icon theme to C:/Python27/icons/
or embed it as a Qt resource.
您可以尝试下载 Faenza Icons.您应该最终得到文件结构如下:
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/
...
这篇关于在win7上pyqt的PyQt QIcon.setThemeSearchPaths()中输入什么路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!