Are there default icons in PyQt/PySide?

2019-03-12 01:10发布

I'm reading a tutorial on PySide and I was thinking , do I need to find my own icons for every thing or is there some way to use some built in icons . That way I wouldn't need to find an entire new set of icons if I want my little gui to run on another desktop environment .

7条回答
看我几分像从前
2楼-- · 2019-03-12 01:58

Another PyQt5 example using the standard icons (eqzx's answer didn't work for me):

 from PyQt5.QtWidgets import QApplication, QStyle
 from PyQt5.QtGui import QIcon

 desktop_icon = QIcon(QApplication.style().standardIcon(QStyle.SP_DesktopIcon)
查看更多
登录 后发表回答