我在实现点击QListWidget中一项时使该项的文字变色 遇到了问题:
这是我写的样式QListWidget::item:pressed{font: 9pt 宋体;color: rgb(0, 153, 255);}
我不知道是子部件item写的不对还是伪状态pressed(checked也试过了)不对,最终都不能实现效果
QListWidget{
border: 1px solid #32435E;
background:rgb(230, 13, 120);
font: 9pt 宋体;
}
QListWidget::item:selected {
/*border: 0px solid #33CCFF;*/
border:none;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #6A848C, stop: 1.0 #0F9EAF);
padding:0px;
margin:0px;
}
QListWidget::item:selected:!active {
border-width: 0px ;
}
QListWidget::item:selected:active {
border-width: 1px;
}
QListWidget::item:hover{
background: rgb(200, 24, 23);
}