|
QListWidget {
show-decoration-selected: 1; /* make the selection span the entire width of the view */
}
QListWidget::item:selected {
border: 1px solid rgb(0, 0, 0);
}
QListWidget::item:selected:!active {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #ABAFE5, stop: 1 #8588B2);
}
QListWidget::item:selected:active {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #6a6ea9, stop: 1 #888dd9);
}
QListWidget::item:hover {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 rgb(220, 200, 200), stop: 1 rgb(80, 80, 80));
}
使用这个样式表,当鼠标点击一个item的时候会有效果,但是你说的松开以后那个效果,默认是没有的,因为ListWidget默认是需要有一个item是选中的,就它的行为而言,没有说点一下再松开那个效果。
上面只是颜色填充,如果想效果再好点就得用图片了。 |
|