how to change Qt qListView Icon selection highlight -
when using qlistview in icon mode need remove hilighting when icon selected. using code below text under icon no longer highlighted still blue color on icon when selected
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);
does know how change selected color on icon without having subclass qstandarditem?
for qlistview qstandarditem's it's possible want. create icon add same pixmap both normal , selected states. seticon in item
qicon icon; icon.addpixmap(yourpixmap,qicon::normal); icon.addpixmap(yourpixmap,qicon::selected); qstandarditem.seticon(icon);
Comments
Post a Comment