PDA

View Full Version : How to remove selection border in QListWidget?



Cthulhu-28
27th May 2018, 03:34
I apply CSS to a QListWidget, however I get a dotted selection border around the text.

I'm using this CSS:

QListWidget {
background-color: white;
show-decoration-selected: 0;
padding:0;
margin:0;
}

QListWidget::item:selected {
border-left: 3px solid #f00;
border-top:none;
border-right:none;
border-bottom:none;
background: #0f0;
}

QListWidget::item:selected:active {
background: #0f0;
border-left: 3px solid #f00;
border-top:none;
border-right:none;
border-bottom:none;
}

QListWidget::item:selected:!active {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #ABAFE5, stop: 1 #8588B2);
}

12834

Thank you.

Added after 6 minutes:

https://stackoverflow.com/questions/50548269/how-to-remove-selection-border-in-qlistwidget