Qt:在QtableView上设置边框底部会禁用selection-background-color

Qt : Setting a border bottom on QtableView disables selection-background-color

本文关键字:底部 selection-background-color 边框 设置 QtableView Qt      更新时间:2023-10-16

我现在在我的QtableView样式表中有这样的东西

QTableView::item 
{
     selection-background-color: rgb(85, 85, 127);
     border-bottom: 1px double #8f8f91;
 }

现在的问题是selection-background-color: rgb(85, 85, 127);只有禁用border-bottom: 1px double #8f8f91;才能生效。有什么建议吗??

如果您想进行自定义,则应该指定任何边界属性。不特定于QSS:

border: 0px solid transparent; // Or any other border