QListWidget QListView QListWidgetItem样式设置
两种方式都可以,一个通用,一个具体 //具体 QListWidget#listWidget_param::Item:hover, QListWidget#listWidget_param::Item:selected { background-color:rgba(22, 29, 36, 1); } QListWidget#listWidget_param::Item:selected:!active { background-color:rgba(22, 29, 36, 1); } //通用 QListWidget::Item:hover, QListWidget::Item:selected { background-color:rgba(22, 29, 36, 1); } QListWidget::Item:selected:!active { background-color:rgba(22, 29, 36, 1); } QListWidget{ //去掉选中时的虚线框 outline:0px; }
QListWidget顶上默认显示边框,隐藏边框:
m_listWidget->setFrameShape(QListWidget::NoFrame);