would like not clickable/highlighted icons in listWidget
问题 I have QListWidget in Pyside2 that has icons populating it. I dont like the icons taking on a shaded grey look when the mouse clicks them. Is there a way to disable this action? I will include a picture. 回答1: You have to use a delegate that disables the QStyle::State_Selected flag: from PySide2 import QtCore, QtGui, QtWidgets class StyledItemDelegate(QtWidgets.QStyledItemDelegate): def initStyleOption(self, option, index): option.state &= ~QtWidgets.QStyle.State_Selected super