pyqt/pyside代码段记录

获取自带icon图

1
2
3
4
5
6
7
style = QtWidgets.QApplication.style()
icon = style.standardIcon(QtWidgets.QStyle.SP_DirIcon)
for i in idea_list:

item = QtWidgets.QListWidgetItem()
item.setText(i.split("_")[1])
item.setIcon(icon)

1.png