0
我試圖用一個圖標來自:如何設置一個Python Qt4窗口圖標?
- https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
- PyQt4 set windows taskbar icon
但它並不會在窗口上顯示:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
import sys
from PyQt4.QtGui import *
# Create an PyQT4 application object.
a = QApplication(sys.argv)
# The QWidget widget is the base class of all user interface objects in PyQt4.
w = QWidget()
# Set window size.
w.resize(820, 240)
# Set window title
w.setWindowTitle("Hello World!")
# https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
undoicon = QIcon.fromTheme("camera-web")
w.setWindowIcon(undoicon)
# Show window
w.show()
sys.exit(a.exec_())
我上午在Windows 10:
- 蟒蛇
conda --version
- >conda 4.3.18
- Python的
python --version
- >Python 2.7.13 :: Anaconda custom (32-bit)
如何捆綁兼容主題? – user
我不知道,但很明顯,你沒有這樣做。 ;-) – ImportanceOfBeingErnest
問題https://stackoverflow.com/questions/29392213/what-path-to-enter-in-pyqt-qicon-setthemesearchpaths-in-pyqt-on-win7似乎有幫助。 – user