2015-04-01 63 views
1

正如寫在docs我想編輯setThemeSearchPaths()從當前代碼:什麼路徑在PyQt QIcon.setThemeSearchPaths()在pyqt在win7中輸入?

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:\Windows\system32\imageres.dll 

但是,如果我輸入.dll文件什麼的路徑會發生什麼?

回答

2

Windows沒有任何圖標主題。 Qt使用freedesktop icon specification

使用默認路徑,將圖標主題提取爲C:/Python27/icons/或將其嵌入爲Qt資源。

你可以嘗試下載Faenza Icons.你應該像文件結構結束:

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

我包埋'.qrc'編譯的文件,以'.py'和它的工作。我使用這個圖標主題http://gnome-look.org/content/show.php/Win2-7+Pack?content=113264 但有些圖標是空文件,比如'folder_open.png' - 請問爲什麼?提取文件時出錯了嗎? – avstenit 2015-04-01 15:59:24

+1

由於某種原因,設計師只是沒有製造這個圖標。你總是可以把你自己的。 – svlasov 2015-04-01 16:13:01