在图标模式下使用qlistview时,我需要在选择图标时完全删除hilighting.使用下面的代码不再突出显示图标下方的文本,但选中后仍然会在图标上显示蓝色
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);
Run Code Online (Sandbox Code Playgroud)
有没有人知道如何在图标上更改所选颜色而不必继承QStandardItem?