QSir 发表于 2013-7-2 10:03
那这个效果可以改变不?
使用样式表来实现吧:
QListView {show-decoration-selected: 1; }
QListView::item { margin: 10px 10px 0px 0px; padding: 10px 10px 2px 2px; }
QListView::item:alternate { background: #EEEEEE; }
QListView::item:selected {
border: 1px solid #6a6ea9; }
QListView::item:selected:!active {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ABAFE5, stop: 1 #8588B2); }
QListView::item:selected:active {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #6a6ea9, stop: 1 #888dd9); }
QListView::item:hover {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #FAFBFE, stop: 1 #DCDEF1); }
margin可以控制行间距。其他代码自己改改吧。
效果截图:
|