在图标模式下使用 qlistview 时,我需要在选择图标时完全删除突出显示。使用图标下方文本下方的代码不再突出显示,但在选择时我仍然会在图标上显示蓝色
QString stylesheet = "";
stylesheet += "QListView::item:alternate {background-image: transparent; background-color: transparent;}";
stylesheet += "QListView::item:selected {background-image: transparent; background-color: transparent;padding: 0px;color: black;}";
stylesheet += "QListView::item:selected:active{background-image: transparent;background-color: transparent; color: black;}";
stylesheet += "QListView::item:selected:!active{background-image: transparent;background-color: transparent;color: black;}";
setStyleSheet(stylesheet);
有谁知道如何更改图标上的选定颜色而不必继承 QStandardItem?